"use strict";

var __assign = this && this.__assign || Object.assign || function(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
        for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
    }
    return t;
}, __extends = this && this.__extends || function() {
    var extendStatics = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(d, b) {
        d.__proto__ = b;
    } || function(d, b) {
        for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
    };
    return function(d, b) {
        function __() {
            this.constructor = d;
        }
        extendStatics(d, b), d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, 
        new __());
    };
}(), powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var FontSize = visuals.Units.FontSize;
        visuals.cartesianLegacyResponsiveViewportsBreakpoints = {
            legendWidth: 76,
            legendHeight: 58,
            axesTitleWidth: 128,
            axesTitleHeight: 58,
            axesHeight: 58,
            axesMedWidth: 128,
            axesWidth: 76,
            maxWidthForMediumFont: 180,
            maxWidthForSmallFont: 128
        };
        var CartesianLegacyResponsiveApplier;
        !function(CartesianLegacyResponsiveApplier) {
            function applyLegacyResponsiveChanges(viewport, cartesianData) {
                applyAxesLegacyResponsiveChanges(viewport, cartesianData), applyLegendLegacyResponsiveChanges(viewport, cartesianData);
            }
            function applyLegendLegacyResponsiveChanges(viewport, cartesianData) {
                if ((viewport.width <= visuals.cartesianLegacyResponsiveViewportsBreakpoints.legendWidth || viewport.height <= visuals.cartesianLegacyResponsiveViewportsBreakpoints.legendHeight) && (cartesianData.legendData.show = !1), 
                viewport.width <= visuals.cartesianLegacyResponsiveViewportsBreakpoints.maxWidthForMediumFont) {
                    var sizePt = cartesianData.legendData.fontProperties.size.pt, minFontSize = void 0;
                    minFontSize = viewport.width <= visuals.cartesianLegacyResponsiveViewportsBreakpoints.maxWidthForSmallFont ? Math.min(sizePt, visuals.SVGLegend.LegendSmallFontSmallViewportInPt) : Math.min(sizePt, visuals.SVGLegend.LegendMediumFontSmallViewportInPt), 
                    cartesianData.legendData.fontProperties = visuals.FontProperties.inherit(cartesianData.legendData.fontProperties, {
                        size: FontSize.createFromPt(minFontSize)
                    });
                }
            }
            function applyAxesLegacyResponsiveChanges(viewport, cartesianData) {
                if (viewport.height <= visuals.cartesianLegacyResponsiveViewportsBreakpoints.axesTitleHeight && (cartesianData.axesData.x.showAxisTitle = !1, 
                cartesianData.axesData.y.showAxisTitle = !1, cartesianData.axesData.y2.showAxisTitle = !1), 
                viewport.width <= visuals.cartesianLegacyResponsiveViewportsBreakpoints.axesTitleWidth && (cartesianData.axesData.y.showAxisTitle = !1, 
                cartesianData.axesData.y2.showAxisTitle = !1), viewport.height <= visuals.cartesianLegacyResponsiveViewportsBreakpoints.axesHeight && (cartesianData.axesData.x.show = !1), 
                viewport.width <= visuals.cartesianLegacyResponsiveViewportsBreakpoints.axesWidth && (cartesianData.axesData.y.show = !1, 
                cartesianData.axesData.y2.show = !1), viewport.width <= visuals.cartesianLegacyResponsiveViewportsBreakpoints.axesMedWidth && visuals.Legend.isLeftOrRight(cartesianData.legendData.position) && (cartesianData.axesData.y.show = !1, 
                cartesianData.axesData.y2.show = !1), viewport.width <= visuals.cartesianLegacyResponsiveViewportsBreakpoints.maxWidthForMediumFont) {
                    var newSizesPx = {
                        x: {
                            tickLabels: visuals.CartesianChart.xAxisSmallFontSizeInPx,
                            title: visuals.CartesianChart.xAxisSmallFontSizeInPx
                        },
                        y: {
                            tickLabels: visuals.CartesianChart.yAxisMediumFontSizeInPx,
                            title: visuals.CartesianChart.yAxisMediumFontSizeInPx
                        },
                        y2: {
                            tickLabels: visuals.CartesianChart.yAxisMediumFontSizeInPx,
                            title: visuals.CartesianChart.yAxisMediumFontSizeInPx
                        }
                    };
                    viewport.width <= visuals.cartesianLegacyResponsiveViewportsBreakpoints.maxWidthForSmallFont && (newSizesPx.y.tickLabels = visuals.CartesianChart.yAxisSmallFontSizeInPx, 
                    newSizesPx.y.title = visuals.CartesianChart.yAxisSmallFontSizeInPx, newSizesPx.y2.tickLabels = visuals.CartesianChart.yAxisSmallFontSizeInPx, 
                    newSizesPx.y2.title = visuals.CartesianChart.yAxisSmallFontSizeInPx), cartesianData.axesData.x.titleFontProperties = visuals.FontProperties.inherit(cartesianData.axesData.x.titleFontProperties, {
                        size: FontSize.createFromPx(newSizesPx.x.title)
                    }), cartesianData.axesData.y.titleFontProperties = visuals.FontProperties.inherit(cartesianData.axesData.y.titleFontProperties, {
                        size: FontSize.createFromPx(newSizesPx.y.title)
                    }), cartesianData.axesData.y2.titleFontProperties = visuals.FontProperties.inherit(cartesianData.axesData.y2.titleFontProperties, {
                        size: FontSize.createFromPx(newSizesPx.y2.title)
                    }), cartesianData.axesData.x.labelFontProperties = visuals.FontProperties.inherit(cartesianData.axesData.x.labelFontProperties, {
                        size: FontSize.createFromPx(newSizesPx.x.tickLabels)
                    }), cartesianData.axesData.y.labelFontProperties = visuals.FontProperties.inherit(cartesianData.axesData.y.labelFontProperties, {
                        size: FontSize.createFromPx(newSizesPx.y.tickLabels)
                    }), cartesianData.axesData.y2.labelFontProperties = visuals.FontProperties.inherit(cartesianData.axesData.y2.labelFontProperties, {
                        size: FontSize.createFromPx(newSizesPx.y2.tickLabels)
                    });
                }
            }
            CartesianLegacyResponsiveApplier.applyLegacyResponsiveChanges = applyLegacyResponsiveChanges;
        }(CartesianLegacyResponsiveApplier = visuals.CartesianLegacyResponsiveApplier || (visuals.CartesianLegacyResponsiveApplier = {}));
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var TextSizeDefaults = jsCommon.TextSizeDefaults;
        visuals.cartesianResponsiveBreakpoints = {
            legendPositionWidth: 210,
            legendPositionHeight: 100,
            legendHeight: 70,
            legendWidth: 80,
            xAxesHeight: 100,
            yAxesTitleWidth: 210,
            yAxesWidth: 100,
            xAxesTitleHeight: 145,
            iconWidth: 50,
            iconHeight: 50,
            fontSizeBreakpoints: [ {
                breakpoint: 240,
                maxFontSizePt: 9
            }, {
                breakpoint: 320,
                maxFontSizePt: 12
            }, {
                breakpoint: 460,
                maxFontSizePt: 16
            }, {
                breakpoint: 540,
                maxFontSizePt: 24
            } ]
        };
        var CartesianViewModelAdapter = function() {
            function CartesianViewModelAdapter(options) {
                this.responsiveCartesianChart = options.responsiveCartesianChart;
            }
            return CartesianViewModelAdapter.prototype.applyChanges = function(viewport, cartesianData, dataView) {
                var responsiveVisualProperties = CartesianViewModelAdapter.getResponsiveVisualProperties(dataView), isResponsiveVisual = responsiveVisualProperties.responsive, isResponsiveLegacyVisual = responsiveVisualProperties.responsiveLegacy;
                return this.responsiveCartesianChart && (isResponsiveVisual || isResponsiveLegacyVisual) && (cartesianData = this.applyResponsiveChanges(viewport, cartesianData, isResponsiveVisual, isResponsiveLegacyVisual)), 
                cartesianData.allowSmallViewport = cartesianData.legendData.allowSmallViewport = !isResponsiveVisual && !isResponsiveLegacyVisual, 
                cartesianData;
            }, CartesianViewModelAdapter.prototype.enumerateObjectInstances = function(options, enumeration, dataView) {
                this.responsiveCartesianChart && "general" === options.objectName && this.enumerateGeneral(enumeration, dataView);
            }, CartesianViewModelAdapter.prototype.createCartesianChartLayerViewModelAdapter = function(cartesianChartLayerType) {
                var responsiveCartesianChart = this.responsiveCartesianChart;
                switch (cartesianChartLayerType) {
                  case 5:
                    return new visuals.ColumnChartLayerViewModelAdapter({
                        responsiveCartesianChart: responsiveCartesianChart
                    });

                  case 0:
                    return new visuals.LineChartLayerViewModelAdapter({
                        responsiveCartesianChart: responsiveCartesianChart
                    });

                  case 2:
                    return new visuals.ScatterChartLayerViewModelAdapter({
                        responsiveCartesianChart: responsiveCartesianChart
                    });

                  case 3:
                    return new visuals.WaterfallChartLayerViewModelAdapter({
                        responsiveCartesianChart: responsiveCartesianChart
                    });
                }
            }, CartesianViewModelAdapter.prototype.enumerateGeneral = function(enumeration, dataView) {
                var responsiveVisualProperties = CartesianViewModelAdapter.getResponsiveVisualProperties(dataView);
                enumeration.pushInstance({
                    selector: null,
                    properties: {
                        responsive: responsiveVisualProperties.responsive
                    },
                    objectName: "general"
                });
            }, CartesianViewModelAdapter.getResponsiveVisualProperties = function(dataView) {
                var settings = {
                    responsive: !1,
                    responsiveLegacy: !1
                };
                if (!dataView || !dataView.metadata) return settings;
                var objects = dataView.metadata.objects;
                return objects && (settings = {
                    responsive: powerbi.DataViewObjects.getValue(objects, visuals.cartesianChartProps.general.responsive, settings.responsive),
                    responsiveLegacy: powerbi.DataViewObjects.getValue(objects, visuals.cartesianChartProps.general.responsiveLegacy, settings.responsiveLegacy)
                }), settings;
            }, CartesianViewModelAdapter.prototype.applyResponsiveChanges = function(viewport, originalCartesianData, isResponsiveVisual, isResponsiveLegacyVisual) {
                var cartesianData = CartesianViewModelAdapter.cloneCartesianData(originalCartesianData), legendPosition = cartesianData.legendData.position;
                return isResponsiveLegacyVisual ? visuals.CartesianLegacyResponsiveApplier.applyLegacyResponsiveChanges(viewport, cartesianData) : isResponsiveVisual && (CartesianViewModelAdapter.applyIconResponsiveChanges(viewport, cartesianData), 
                CartesianViewModelAdapter.applyLegendResponsiveChanges(viewport, legendPosition, cartesianData), 
                CartesianViewModelAdapter.applyAxesResponsiveChanges(viewport, cartesianData), CartesianViewModelAdapter.applyFontSizesChanges(viewport, cartesianData), 
                CartesianViewModelAdapter.applyScrollbarChanges(viewport, cartesianData)), this.updateResponsiveWarnings(cartesianData.warningObjectCollection, cartesianData, originalCartesianData), 
                cartesianData;
            }, CartesianViewModelAdapter.cloneCartesianData = function(originalCartesianData) {
                var cartesianData = _.cloneDeep(originalCartesianData);
                return powerbi.Prototype.copyPrototypeDeep(originalCartesianData, cartesianData), 
                cartesianData;
            }, CartesianViewModelAdapter.applyIconResponsiveChanges = function(viewport, cartesianData) {
                (viewport.height <= visuals.cartesianResponsiveBreakpoints.iconHeight || viewport.width <= visuals.cartesianResponsiveBreakpoints.iconWidth) && (cartesianData.showIcon = !0);
            }, CartesianViewModelAdapter.applyLegendResponsiveChanges = function(viewport, legendPosition, cartesianData) {
                (viewport.width < visuals.cartesianResponsiveBreakpoints.legendPositionWidth || viewport.height < visuals.cartesianResponsiveBreakpoints.legendPositionHeight) && visuals.Legend.isLeftOrRight(legendPosition) && (cartesianData.legendData.position = visuals.LegendPosition.Top), 
                (viewport.height < visuals.cartesianResponsiveBreakpoints.legendHeight || viewport.width < visuals.cartesianResponsiveBreakpoints.legendWidth) && (cartesianData.legendData.show = !1);
            }, CartesianViewModelAdapter.applyScrollbarChanges = function(viewport, cartesianData) {
                cartesianData.scrollbarOptions = CartesianViewModelAdapter.ScrollbarOptions;
            }, CartesianViewModelAdapter.applyAxesResponsiveChanges = function(viewport, cartesianData) {
                viewport.height < visuals.cartesianResponsiveBreakpoints.xAxesHeight && (cartesianData.axesData.x.show = !1), 
                viewport.width < visuals.cartesianResponsiveBreakpoints.yAxesTitleWidth && (cartesianData.axesData.y.showAxisTitle = !1, 
                cartesianData.axesData.y2.showAxisTitle = !1), viewport.width < visuals.cartesianResponsiveBreakpoints.yAxesWidth && (cartesianData.axesData.y.show = !1, 
                cartesianData.axesData.y2.show = !1), viewport.height < visuals.cartesianResponsiveBreakpoints.xAxesTitleHeight && (cartesianData.axesData.x.showAxisTitle = !1);
            }, CartesianViewModelAdapter.applyFontSizesChanges = function(viewport, cartesianData) {
                var maxFontSizePt = CartesianViewModelAdapter.resolveMaxFontSizePtForViewport(viewport, TextSizeDefaults.TextSizeMax);
                if (maxFontSizePt < TextSizeDefaults.TextSizeMax) {
                    var inheritAndScaleFontProperties = function(p) {
                        return CartesianViewModelAdapter.inheritAndScaleFontProperties(p, maxFontSizePt);
                    };
                    cartesianData.legendData.fontProperties = inheritAndScaleFontProperties(cartesianData.legendData.fontProperties), 
                    cartesianData.axesData.x.labelFontProperties = inheritAndScaleFontProperties(cartesianData.axesData.x.labelFontProperties), 
                    cartesianData.axesData.x.titleFontProperties = inheritAndScaleFontProperties(cartesianData.axesData.x.titleFontProperties), 
                    cartesianData.axesData.y.labelFontProperties = inheritAndScaleFontProperties(cartesianData.axesData.y.labelFontProperties), 
                    cartesianData.axesData.y.titleFontProperties = inheritAndScaleFontProperties(cartesianData.axesData.y.titleFontProperties), 
                    cartesianData.axesData.y2.labelFontProperties = inheritAndScaleFontProperties(cartesianData.axesData.y2.labelFontProperties), 
                    cartesianData.axesData.y2.titleFontProperties = inheritAndScaleFontProperties(cartesianData.axesData.y2.titleFontProperties);
                }
            }, CartesianViewModelAdapter.prototype.updateResponsiveWarnings = function(warningObjectCollection, cartesianData, originalCartesianData) {
                if (this.responsiveCartesianChart) {
                    var warnings = {}, legendData = cartesianData.legendData, originalLegendData = originalCartesianData.legendData;
                    if (cartesianData.showIcon) warnings.legend = new visuals.LegendNotRenderedWarning(), 
                    warnings.categoryAxis = new visuals.AxisAndAxisLabelsNotRenderedWarning(), warnings.valueAxis = new visuals.AxisAndAxisLabelsNotRenderedWarning(); else {
                        legendData.show !== originalLegendData.show ? warnings.legend = new visuals.LegendNotRenderedWarning() : legendData.position !== originalLegendData.position ? warnings.legend = new visuals.LegendLocationWarning() : _.isEqual(legendData.fontProperties.size, originalLegendData.fontProperties.size) || (warnings.legend = new visuals.LegendFontSizeWarning());
                        var axesData = cartesianData.axesData, originalAxesData = originalCartesianData.axesData;
                        axesData.categoryAxis.show !== originalAxesData.categoryAxis.show ? warnings.categoryAxis = new visuals.AxisAndAxisLabelsNotRenderedWarning() : axesData.categoryAxis.showAxisTitle !== originalAxesData.categoryAxis.showAxisTitle ? warnings.categoryAxis = new visuals.AxisLabelsNotRenderedWarning() : _.isEqual(axesData.categoryAxis.labelFontProperties.size, originalAxesData.categoryAxis.labelFontProperties.size) && _.isEqual(axesData.categoryAxis.titleFontProperties.size, originalAxesData.categoryAxis.titleFontProperties.size) || (warnings.categoryAxis = new visuals.AxisFontSizeWarning()), 
                        axesData.valueAxis.show !== originalAxesData.valueAxis.show ? warnings.valueAxis = new visuals.AxisAndAxisLabelsNotRenderedWarning() : axesData.valueAxis.showAxisTitle !== originalAxesData.valueAxis.showAxisTitle ? warnings.valueAxis = new visuals.AxisLabelsNotRenderedWarning() : _.isEqual(axesData.valueAxis.labelFontProperties.size, originalAxesData.valueAxis.labelFontProperties.size) && _.isEqual(axesData.valueAxis.titleFontProperties.size, originalAxesData.valueAxis.titleFontProperties.size) || (warnings.valueAxis = new visuals.AxisFontSizeWarning());
                    }
                    for (var key in warnings) {
                        var warning = warnings[key], labelWarning = {
                            selector: null,
                            warnings: [ warning ]
                        };
                        warningObjectCollection.addForVisualObject(key, labelWarning);
                    }
                }
            }, CartesianViewModelAdapter.resolveMaxFontSizePtForViewport = function(viewport, defaultMaxSizePt) {
                for (var fontSizeBreakpoints = visuals.cartesianResponsiveBreakpoints.fontSizeBreakpoints, maxFontSizePt = defaultMaxSizePt, _i = 0, fontSizeBreakpoints_1 = fontSizeBreakpoints; _i < fontSizeBreakpoints_1.length; _i++) {
                    var fontSizeBreakpoint = fontSizeBreakpoints_1[_i];
                    if (viewport.height < fontSizeBreakpoint.breakpoint || viewport.width < fontSizeBreakpoint.breakpoint) {
                        maxFontSizePt = fontSizeBreakpoint.maxFontSizePt;
                        break;
                    }
                }
                return maxFontSizePt;
            }, CartesianViewModelAdapter.inheritAndScaleFontProperties = function(props, maxFontSizePt) {
                if (maxFontSizePt >= props.size.pt) return props;
                var newSize = visuals.Units.FontSize.createFromPt(maxFontSizePt);
                return visuals.FontProperties.inherit(props, {
                    size: newSize
                });
            }, CartesianViewModelAdapter.ScrollbarOptions = {
                scrollbarWidth: 8,
                scrollbarRadius: 4,
                scrollbarClass: "responsive"
            }, CartesianViewModelAdapter;
        }();
        visuals.CartesianViewModelAdapter = CartesianViewModelAdapter;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var ColumnChartLayerViewModelAdapter = function() {
            function ColumnChartLayerViewModelAdapter(options) {
                this.responsiveCartesianChart = options.responsiveCartesianChart;
            }
            return ColumnChartLayerViewModelAdapter.prototype.applyChanges = function(viewport, originalCartesianData, dataView) {
                throw new Error("Method not implemented.");
            }, ColumnChartLayerViewModelAdapter.prototype.enumerateObjectInstances = function(options, enumeration, dataView) {
                throw new Error("Method not implemented.");
            }, ColumnChartLayerViewModelAdapter.prototype.getCartesianChartLayerType = function() {
                return 5;
            }, ColumnChartLayerViewModelAdapter;
        }();
        visuals.ColumnChartLayerViewModelAdapter = ColumnChartLayerViewModelAdapter;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var LineChartLayerViewModelAdapter = function() {
            function LineChartLayerViewModelAdapter(options) {
                this.responsiveCartesianChart = options.responsiveCartesianChart;
            }
            return LineChartLayerViewModelAdapter.prototype.applyChanges = function(viewport, originalCartesianData, dataView) {
                throw new Error("Method not implemented.");
            }, LineChartLayerViewModelAdapter.prototype.enumerateObjectInstances = function(options, enumeration, dataView) {
                throw new Error("Method not implemented.");
            }, LineChartLayerViewModelAdapter.prototype.getCartesianChartLayerType = function() {
                return 0;
            }, LineChartLayerViewModelAdapter;
        }();
        visuals.LineChartLayerViewModelAdapter = LineChartLayerViewModelAdapter;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var ScatterChartLayerViewModelAdapter = function() {
            function ScatterChartLayerViewModelAdapter(options) {
                this.responsiveCartesianChart = options.responsiveCartesianChart;
            }
            return ScatterChartLayerViewModelAdapter.prototype.applyChanges = function(viewport, originalCartesianData, dataView) {
                throw new Error("Method not implemented.");
            }, ScatterChartLayerViewModelAdapter.prototype.enumerateObjectInstances = function(options, enumeration, dataView) {
                throw new Error("Method not implemented.");
            }, ScatterChartLayerViewModelAdapter.prototype.getCartesianChartLayerType = function() {
                return 2;
            }, ScatterChartLayerViewModelAdapter;
        }();
        visuals.ScatterChartLayerViewModelAdapter = ScatterChartLayerViewModelAdapter;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var WaterfallChartLayerViewModelAdapter = function() {
            function WaterfallChartLayerViewModelAdapter(options) {
                this.responsiveCartesianChart = options.responsiveCartesianChart;
            }
            return WaterfallChartLayerViewModelAdapter.prototype.applyChanges = function(viewport, originalCartesianData, dataView) {
                throw new Error("Method not implemented.");
            }, WaterfallChartLayerViewModelAdapter.prototype.enumerateObjectInstances = function(options, enumeration, dataView) {
                throw new Error("Method not implemented.");
            }, WaterfallChartLayerViewModelAdapter.prototype.getCartesianChartLayerType = function() {
                return 3;
            }, WaterfallChartLayerViewModelAdapter;
        }();
        visuals.WaterfallChartLayerViewModelAdapter = WaterfallChartLayerViewModelAdapter;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var AxesData = visuals.AxisDataModel.AxesData, DataViewConcatenateUtil = powerbi.visuals.DataViewConcatenateUtil, FontSize = visuals.Units.FontSize, SvgScrollbar = powerbi.visuals.controls.SvgScrollbar, INTERACTIVITY_RIGHT_MARGIN = 6, CartesianChart = function() {
            function CartesianChart(options) {
                var isScrollable = !1, animateCategoryAxis = !1, animateValueAxis = !1;
                this.trimOrdinalDataOnOverflow = !0, options && (this.tooltipsEnabled = options.tooltipsEnabled, 
                this.touchScreenOptimizedTooltipsEnabled = options.touchScreenOptimizedTooltipsEnabled, 
                this.forecastEnabled = options.forecastEnabled, this.type = options.chartType, this.isLabelInteractivityEnabled = options.isLabelInteractivityEnabled, 
                this.axisControlImprovements = options.axisControlImprovements, this.responsiveCartesianChart = options.responsiveCartesianChart, 
                this.binnedLineSampling = options.binnedLineSamplingSupported, this.scatterWithMatrixDV = options.scatterWithMatrixDV, 
                this.scatterWithDataVolume = options.scatterWithDataVolume, this.waterfallBreakdown = options.waterfallBreakdown, 
                void 0 !== options.trimOrdinalDataOnOverflow && (this.trimOrdinalDataOnOverflow = options.trimOrdinalDataOnOverflow), 
                options.isScrollable && (isScrollable = options.isScrollable), this.animator = options.animator, 
                options.cartesianSmallViewPortProperties && (this.cartesianSmallViewPortProperties = options.cartesianSmallViewPortProperties), 
                options.legendSmallViewPortProperties && (this.legendSmallViewPortProperties = options.legendSmallViewPortProperties), 
                options.behavior && (this.behavior = options.behavior), options.viewModelAdapter && (this.viewModelAdapter = options.viewModelAdapter), 
                this.lassoSelectEnabled = options.lassoSelectEnabled, animateCategoryAxis = options.animateCategoryAxis, 
                animateValueAxis = options.animateValueAxis, this.viewMode = 0, this.customFontFamily = options.customFontFamily, 
                this.customFontFamilyForDataLabel = options.customFontFamilyForDataLabel, this.lineMarkersEnabled = options.lineMarkersEnabled, 
                this.lineStylesEnabled = options.lineStylesEnabled), this.isCartesianChartVisible = !0, 
                this.axes = new visuals.CartesianAxes(isScrollable, ScrollableAxes.ScrollbarWidth, this.trimOrdinalDataOnOverflow), 
                this.svgAxes = new visuals.SvgCartesianAxes(this.axes), this.svgScrollbar = new SvgScrollbar({
                    scrollbarWidth: ScrollableAxes.ScrollbarWidth
                }), this.scrollableAxes = new ScrollableAxes(this.axes, this.svgScrollbar, animateCategoryAxis, animateValueAxis), 
                this.lassoSelectEnabled && (this.lassoManager = new visuals.LassoManager());
            }
            return CartesianChart.shouldYAxisBeCategorical = function(type) {
                switch (type) {
                  case 6:
                  case 5:
                  case 7:
                    return !0;
                }
                return !1;
            }, CartesianChart.prototype.init = function(options) {
                this.visualInitOptions = options, this.layers = [];
                var element = this.element = options.element;
                this.visibilityHelper = powerbi.requireSync("Visuals/common/responsiveVisualUtil").visibilityHelper(this.element, CartesianChart.IconClassName), 
                this.currentViewport = options.viewport, this.hostServices = options.host;
                var chartAreaSvg = this.chartAreaSvg = d3.select(element.get(0)).append("svg");
                chartAreaSvg.classed(CartesianChart.ClassName, !0), chartAreaSvg.style("position", "absolute"), 
                this.behavior && (this.clearCatcher = visuals.appendClearCatcher(chartAreaSvg), 
                this.interactivityService = visuals.createInteractivityService(this.hostServices), 
                this.lassoSelectEnabled && (this.lassoManager.init(chartAreaSvg), this.lassoSelectionBehavior = new visuals.LassoSelectionBehavior(this.behavior), 
                this.lassoManager.behaviors.push(this.lassoSelectionBehavior))), this.axes.init({
                    maxMarginFactor: options.style.maxMarginFactor,
                    isYAxisCategorical: CartesianChart.shouldYAxisBeCategorical(this.type)
                }), this.svgAxes.init(chartAreaSvg), this.svgScrollbar.init(chartAreaSvg), this.legend = visuals.createLegend(element, options.interactivity && options.interactivity.isInteractiveLegend, 13 !== this.type ? this.interactivityService : void 0, this.axes.isScrollable, void 0, this.legendSmallViewPortProperties), 
                this.isMobileChart = options.interactivity && options.interactivity.isInteractiveLegend, 
                this.tooltipService = visuals.createTooltipService(options.host, this.touchScreenOptimizedTooltipsEnabled), 
                this.viewMode = options.host.getViewMode();
                var style = this.visualInitOptions.style, layerStyle = powerbi.Prototype.inherit(this.visualInitOptions.style);
                layerStyle.colorPalette = powerbi.Prototype.inherit(style.colorPalette), layerStyle.colorPalette.dataColors = new SharedColorPalette(options.style.colorPalette.dataColors), 
                this.layerStyle = layerStyle;
            }, CartesianChart.prototype.isPlayAxis = function() {
                if (!this.dataViews || !this.dataViews[0]) return !1;
                var dataView = this.dataViews[0];
                return 10 === this.type && (this.animator || this.isMobileChart) && powerbi.data.DataRoleHelper.hasRoleInDataView(dataView, "Play");
            }, CartesianChart.populateObjectProperties = function(dataViews, referenceLines, layerStyle) {
                if (dataViews && dataViews.length > 0) {
                    var dataView = dataViews[0], dataViewMetadata = dataView.metadata;
                    dataViewMetadata && referenceLines.push.apply(referenceLines, CartesianChart.getStaticReferenceLines(dataViewMetadata, layerStyle));
                }
            }, CartesianChart.getStaticReferenceLines = function(dataViewMetadata, layerStyle) {
                var defaultColor = layerStyle.colorPalette.dataColors.getColorByIndex(0).value, referenceLines = [], xAxisReferenceLines = powerbi.DataViewObjects.getUserDefinedObjects(dataViewMetadata.objects, "xAxisReferenceLine");
                referenceLines.push.apply(referenceLines, visuals.ReferenceLineHelper.readDataView(xAxisReferenceLines, defaultColor, "xAxisReferenceLine", 0));
                var y1AxisReferenceLines = powerbi.DataViewObjects.getUserDefinedObjects(dataViewMetadata.objects, "y1AxisReferenceLine");
                return referenceLines.push.apply(referenceLines, visuals.ReferenceLineHelper.readDataView(y1AxisReferenceLines, defaultColor, "y1AxisReferenceLine", 1)), 
                referenceLines;
            }, CartesianChart.getDataBoundReferenceLines = function(layerDataView, layer, layerStyle, readMatrix) {
                var referenceLines = [], metadataColumns = [];
                if (layerDataView) if (!readMatrix && layerDataView.categorical && layerDataView.categorical.values) {
                    var columnGroup = _.first(layerDataView.categorical.values.grouped());
                    if (columnGroup) for (var _i = 0, _a = columnGroup.values; _i < _a.length; _i++) {
                        var valueColumn = _a[_i];
                        metadataColumns.push(valueColumn.source);
                    }
                } else layerDataView.matrix && layerDataView.matrix.valueSources && (metadataColumns = layerDataView.matrix.valueSources);
                for (var defaultColor = layerStyle.colorPalette.dataColors.getColorByIndex(0).value, _b = 0, metadataColumns_1 = metadataColumns; _b < metadataColumns_1.length; _b++) {
                    var metadataColumn = metadataColumns_1[_b], dataBoundReferenceLines = powerbi.DataViewObjects.getUserDefinedObjects(metadataColumn.objects, "referenceLine"), axisLocation = CartesianChart.getCartesianRoleKind(metadataColumn, layer);
                    referenceLines.push.apply(referenceLines, visuals.ReferenceLineHelper.readDataView(dataBoundReferenceLines, defaultColor, "referenceLine", axisLocation, metadataColumn.queryName));
                }
                return referenceLines;
            }, CartesianChart.getCartesianRoleKind = function(column, layer) {
                var dataRoles = column.roles;
                if (layer.getAxisLocationForRole && dataRoles) for (var roleName in dataRoles) if (dataRoles[roleName]) return layer.getAxisLocationForRole(roleName);
                return 1;
            }, CartesianChart.converter = function(options) {
                var legendData, dataViews = options.dataViews, layers = options.layers, layerStyle = options.layerStyle, categoryAxisTitleOnByDefault = options.categoryAxisTitleOnByDefault, valueAxisTitleOnByDefault = options.valueAxisTitleOnByDefault, chartType = options.chartType, hasDataChanged = options.hasDataChanged, scrollbarOptions = {
                    scrollbarWidth: ScrollableAxes.ScrollbarWidth
                }, trendLines = [], referenceLines = [], showIcon = !1, layerDataViews = CartesianChart.getLayerDataViews(dataViews), forecastDataViews = _.filter(dataViews, visuals.ForecastHelper.isDataViewForForecast), layerLegendData = [], allowLegendWithNoSeries = layers.length > 1 && !!(dataViews[0] && dataViews[0].categorical && dataViews[0].categorical.values), sharedColorPalette = layerStyle.colorPalette.dataColors;
                sharedColorPalette.clearPreferredScale();
                for (var trendLineDataViews = _.filter(dataViews, visuals.TrendLineHelper.isDataViewForRegression), warningObjectCollection = new visuals.VisualWarningBuilder(), allowSmallViewport = !1, i = 0, layerCount = layers.length; i < layerCount; i++) {
                    var layerDataView = layerDataViews[i], layer = layers[i], currentLayerDataViews = layerDataView ? [ layerDataView ] : [];
                    null != forecastDataViews[i] && currentLayerDataViews.push(forecastDataViews[i]), 
                    layers[i].setData(currentLayerDataViews);
                    var legendDataLayer = CartesianChart.getLegendDataForLayer(layer, layerDataView, layerStyle, allowLegendWithNoSeries);
                    if (legendDataLayer && layerLegendData.push(legendDataLayer), referenceLines.push.apply(referenceLines, CartesianChart.getDataBoundReferenceLines(layerDataView, layers[i], layerStyle, options.readMatrix)), 
                    CartesianChart.supportsTrendLines(dataViews, layers, i)) {
                        var trendLineDataView = trendLineDataViews[i];
                        if (trendLineDataView) {
                            var y2 = i > 0, layerTrendLines = visuals.TrendLineHelper.readDataView(trendLineDataView, layerDataView, y2, sharedColorPalette, options.readMatrix);
                            trendLines.push.apply(trendLines, layerTrendLines);
                        }
                    }
                    layerCount > 1 && sharedColorPalette.rotateScale();
                }
                legendData = layerLegendData.length > 1 ? visuals.Legend.mergeLegendData(layerLegendData, !0) : 1 === layerLegendData.length ? layerLegendData[0] : visuals.Legend.getDefaultLegendData();
                var axesData;
                if (_.isEmpty(dataViews)) axesData = AxesData.createDefault(); else {
                    var dataView = dataViews[0], dataViewMetadata = dataView.metadata, hasScalarKeys = !1;
                    dataViewMetadata && dataView.categorical && !_.isEmpty(dataView.categorical.categories) && (hasScalarKeys = !!visuals.ScalarUtils.getScalarKeys(dataView.categorical.categories[0]));
                    var categoryAxisProperties = visuals.CartesianHelper.getCategoryAxisProperties(dataViewMetadata, hasScalarKeys || categoryAxisTitleOnByDefault), valueAxisProperties = visuals.CartesianHelper.getValueAxisProperties(dataViewMetadata, valueAxisTitleOnByDefault);
                    axesData = new AxesData(valueAxisProperties, categoryAxisProperties, CartesianChart.shouldYAxisBeCategorical(chartType), (!CartesianChart.supportsValueAxis(dataViews, layers)), 10 === chartType), 
                    hasDataChanged && CartesianChart.populateObjectProperties(dataViews, referenceLines, layerStyle);
                }
                return {
                    legendData: legendData,
                    trendLines: trendLines,
                    referenceLines: referenceLines,
                    axesData: axesData,
                    warningObjectCollection: warningObjectCollection,
                    showIcon: showIcon,
                    allowSmallViewport: allowSmallViewport,
                    scrollbarOptions: scrollbarOptions
                };
            }, CartesianChart.getLegendDataForLayer = function(layer, layerDataView, layerStyle, allowLegendWithNoSeries) {
                var legendDataLayer;
                return layer.calculateCustomLegend ? legendDataLayer = layer.calculateCustomLegend() : layerDataView && (legendDataLayer = visuals.Legend.buildSeriesLegendData({
                    dataView: layerDataView,
                    showByDefault: !0,
                    staticSeriesRole: layer.getStaticSeriesRole(),
                    style: layerStyle,
                    allowLegendWithNoSeries: allowLegendWithNoSeries
                })), legendDataLayer;
            }, CartesianChart.prototype.updateInternal = function(options, operationKind) {
                var dataViews = this.dataViews = options.dataViews;
                if (this.currentViewport = options.viewport, dataViews) {
                    if (0 === this.layers.length) {
                        var objects = this.extractMetadataObjects(dataViews);
                        this.layers = this.createAndInitLayers(objects);
                    }
                    var renderMode, layers = this.layers, categoryAxisTitleOnByDefault = _.any(layers, function(layer) {
                        return layer.categoryAxisTitleOnByDefault && layer.categoryAxisTitleOnByDefault();
                    }), valueAxisTitleOnByDefault = _.any(layers, function(layer) {
                        return layer.valueAxisTitleOnByDefault && layer.valueAxisTitleOnByDefault();
                    });
                    if (null != operationKind) {
                        if (!_.isEmpty(dataViews)) {
                            for (var layerDataViews = CartesianChart.getLayerDataViews(dataViews), layerRenderModes = void 0, i = 0, layerCount = layers.length; i < layerCount; i++) {
                                var layerDataView = layerDataViews[i];
                                if (null != layerDataView) {
                                    var layer = layers[i], layerCartesianVisualCapabilities = layer.getCartesianVisualCapabilities();
                                    this.cartesianVisualCapabilities ? this.cartesianVisualCapabilities.supportsHierarchicalCategoryAxis = this.cartesianVisualCapabilities.supportsHierarchicalCategoryAxis && layerCartesianVisualCapabilities.supportsHierarchicalCategoryAxis : this.cartesianVisualCapabilities = powerbi.Prototype.inherit(layerCartesianVisualCapabilities);
                                    var renderModes = new CartesianAxisRenderModeSelector(layerDataView, layerCartesianVisualCapabilities.supportsHierarchicalCategoryAxis).getRenderModes();
                                    layerRenderModes = layerRenderModes ? _.intersection(layerRenderModes, renderModes) : renderModes;
                                }
                            }
                            renderMode = this.categoryAxisRenderMode = _.first(layerRenderModes), 2 === renderMode && (dataViews = dataViews.map(function(dataView) {
                                return DataViewConcatenateUtil.concatenateCategories(dataView, visuals.columnChartProps.general.formatString, visuals.cartesianRoleNames.category);
                            }));
                        }
                        this.cartesianData = this.originalCartesianData = CartesianChart.converter({
                            layerStyle: this.layerStyle,
                            chartType: this.type,
                            dataViews: dataViews,
                            categoryAxisTitleOnByDefault: categoryAxisTitleOnByDefault,
                            valueAxisTitleOnByDefault: valueAxisTitleOnByDefault,
                            layers: layers,
                            readMatrix: this.scatterWithMatrixDV,
                            hasDataChanged: null != operationKind
                        });
                    }
                    if (this.viewModelAdapter && !_.isEmpty(dataViews) && (this.cartesianData = this.viewModelAdapter.applyChanges(this.currentViewport, this.originalCartesianData, dataViews[0])), 
                    null == operationKind && this.cartesianData && this.cartesianData.axesData) this.axes.updateResize(this.cartesianData.axesData, this.cartesianData.scrollbarOptions.scrollbarWidth), 
                    this.svgAxes.update(this.cartesianData.axesData); else if (null != operationKind && !_.isEmpty(dataViews)) {
                        var dataView = dataViews[0];
                        dataView.metadata && (this.background = {
                            image: powerbi.DataViewObjects.getValue(dataView.metadata.objects, visuals.scatterChartProps.plotArea.image),
                            transparency: powerbi.DataViewObjects.getValue(dataView.metadata.objects, visuals.scatterChartProps.plotArea.transparency, visuals.visualBackgroundHelper.getDefaultTransparency())
                        }, 0 === renderMode && this.loadMoreDataHandler ? this.loadMoreDataHandler = null : 0 === renderMode || this.loadMoreDataHandler || (this.loadMoreDataHandler = new CartesianLoadMoreDataHandler(null, this.hostServices.loadMoreData, CartesianChart.LoadMoreThreshold))), 
                        this.axes.update(dataView.categorical ? dataView.categorical.categories : null, this.cartesianData.axesData, renderMode, this.cartesianData.scrollbarOptions.scrollbarWidth), 
                        this.svgAxes.update(this.cartesianData.axesData);
                    }
                    this.cartesianData && this.svgScrollbar.updateScrollbarOptions(this.cartesianData.scrollbarOptions), 
                    this.loadMoreDataHandler && null != operationKind && this.loadMoreDataHandler.onLoadMoreDataCompleted(), 
                    this.render(!this.hasSetData || options.suppressAnimations, options.resizeMode, operationKind), 
                    this.hasSetData = this.hasSetData || !_.isEmpty(dataViews), this.updateWarnings(this.cartesianData.warningObjectCollection);
                }
            }, CartesianChart.prototype.updateWarnings = function(warningObjectCollection) {
                if (!_.isEmpty(this.dataViews)) {
                    var dataViews = this.dataViews, warnings = visuals.getInvalidValueWarnings(dataViews, !1, !1, !1, [ "Tooltips" ], this.scatterWithMatrixDV);
                    if (_.isEmpty(warnings) || warningObjectCollection.add.apply(warningObjectCollection, warnings), 
                    this.axes.addWarnings(warningObjectCollection), this.noLabelsCanBeRendered) {
                        var labelWarning = {
                            selector: null,
                            warnings: [ new visuals.DataLabelsNotRenderedWarning() ]
                        };
                        warningObjectCollection.addForVisualObject("labels", labelWarning);
                    } else warningObjectCollection.removeForVisualObject("labels");
                    for (var renderModeWarnings = [], supportsHierarchicalCategoryAxis = this.cartesianVisualCapabilities && this.cartesianVisualCapabilities.supportsHierarchicalCategoryAxis, _i = 0, dataViews_1 = dataViews; _i < dataViews_1.length; _i++) {
                        var dataView = dataViews_1[_i];
                        new CartesianAxisRenderModeSelector(dataView, supportsHierarchicalCategoryAxis).addObjectWarnings(renderModeWarnings);
                    }
                    _.isEmpty(renderModeWarnings) || (_a = this.cartesianData.warningObjectCollection).addForVisualObject.apply(_a, [ "categoryAxis" ].concat(renderModeWarnings)), 
                    this.hostServices.setWarnings(this.cartesianData.warningObjectCollection.complete());
                }
                var _a;
            }, CartesianChart.prototype.onDataChanged = function(options) {
                this.updateInternal({
                    dataViews: options.dataViews,
                    suppressAnimations: options.suppressAnimations,
                    viewport: this.currentViewport
                }, null != options.operationKind ? options.operationKind : powerbi.VisualDataChangeOperationKind.Create);
            }, CartesianChart.prototype.onResizing = function(viewport, resizeMode) {
                this.updateInternal({
                    dataViews: this.dataViews,
                    suppressAnimations: !0,
                    viewport: viewport,
                    resizeMode: resizeMode
                });
            }, CartesianChart.prototype.onViewModeChanged = function(viewMode) {
                this.viewMode = viewMode;
            }, CartesianChart.prototype.bindTouchEvents = function(axesLayout, chartAreaSvg) {
                var _this = this, previousTouchPosition = {
                    x: 0,
                    y: 0
                };
                chartAreaSvg.on("touchstart", function() {
                    if (0 === _this.viewMode && (axesLayout.isXScrollBarVisible || axesLayout.isYScrollBarVisible)) {
                        var touchEvent = d3.event, touch = touchEvent.changedTouches[0];
                        previousTouchPosition.x = touch.pageX, previousTouchPosition.y = touch.pageY;
                    }
                }), chartAreaSvg.on("touchmove", function() {
                    if (0 === _this.viewMode && (axesLayout.isXScrollBarVisible || axesLayout.isYScrollBarVisible)) {
                        _this.tooltipService.hide();
                        var touchEvent = d3.event, touch = touchEvent.changedTouches[0], dX = previousTouchPosition.x - touch.pageX, dY = previousTouchPosition.y - touch.pageY, delta = axesLayout.isXScrollBarVisible ? dX : dY;
                        _this.scrollableAxes.scrollDelta(delta), previousTouchPosition.x = touch.pageX, 
                        previousTouchPosition.y = touch.pageY, touchEvent.preventDefault();
                    }
                });
            }, CartesianChart.prototype.bindScrollWheelEvents = function(axesLayout, chartAreaSvg) {
                var _this = this;
                chartAreaSvg.on("wheel", function() {
                    if (axesLayout.isXScrollBarVisible || axesLayout.isYScrollBarVisible) {
                        _this.tooltipService.hide();
                        var wheelEvent = d3.event, dX = wheelEvent.deltaX, dY = wheelEvent.deltaY, delta = Math.abs(dX) > Math.abs(dY) ? dX : dY;
                        _this.scrollableAxes.scrollDelta(delta), wheelEvent.preventDefault();
                    }
                });
            }, CartesianChart.prototype.scrollTo = function(position) {
                this.scrollableAxes.scrollTo(position);
            }, CartesianChart.prototype.enumerateObjectInstances = function(options) {
                var enumeration = new visuals.ObjectEnumerationBuilder(), layersLength = this.layers ? this.layers.length : 0;
                if ("legend" === options.objectName) {
                    if (!this.shouldShowLegendCard()) return;
                    var options_1 = {
                        enumeration: enumeration,
                        legendData: this.originalCartesianData.legendData,
                        customFontFamily: this.customFontFamily
                    };
                    1 === layersLength && this.layers[0].enumerateCustomLegend ? this.layers[0].enumerateCustomLegend(options_1) : visuals.Legend.enumerate(options_1);
                } else "categoryAxis" === options.objectName && this.axes.hasCategoryAxis() ? this.enumerateCategoryAxis(enumeration) : "valueAxis" === options.objectName ? this.enumerateValueAxis(enumeration) : "y1AxisReferenceLine" === options.objectName || "xAxisReferenceLine" === options.objectName ? this.enumerateReferenceLines(enumeration, options.objectName) : "referenceLine" === options.objectName ? CartesianChart.supportsDataBoundReferenceLines(this.dataViews, this.layers) && this.enumerateReferenceLines(enumeration, options.objectName) : "trend" === options.objectName ? CartesianChart.supportsTrendLines(this.dataViews, this.layers) && visuals.TrendLineHelper.enumerateObjectInstances(enumeration, this.originalCartesianData.trendLines) : ("forecast" !== options.objectName || this.forecastEnabled) && "plotArea" === options.objectName && visuals.visualBackgroundHelper.enumeratePlot(enumeration, this.background);
                if ("dataPoint" === options.objectName && visuals.ComboChart.isComboChart(this.type)) visuals.ComboChart.enumerateDataPoints(enumeration, options, this.layers); else for (var i = 0, len = layersLength; i < len; i++) {
                    var layer = this.layers[i];
                    layer.enumerateObjectInstances && layer.enumerateObjectInstances(enumeration, options);
                }
                if (this.viewModelAdapter) {
                    !this.dataViews || !this.dataViews[0];
                    var dataView = this.dataViews[0];
                    this.viewModelAdapter.enumerateObjectInstances(options, enumeration, dataView);
                }
                return enumeration.complete();
            }, CartesianChart.prototype.enumerateReferenceLines = function(enumeration, type) {
                var refLinedefaultColor = this.layerStyle.colorPalette.dataColors.getColorByIndex(0).value, refLines = _.filter(this.originalCartesianData.referenceLines, function(refLine) {
                    return refLine.type === type;
                });
                visuals.ReferenceLineHelper.enumerateObjectInstances(enumeration, refLines, refLinedefaultColor, type, this.originalCartesianData.axesData.isValueAxisDisabled);
            }, CartesianChart.supportsTrendLines = function(dataViews, layers, layerIndex) {
                return CartesianChart.allLayerSupports(function(layer) {
                    return layer.supportsTrendLine && layer.supportsTrendLine();
                }, dataViews, layers, layerIndex);
            }, CartesianChart.supportsValueAxis = function(dataViews, layers, layerIndex) {
                return CartesianChart.allLayerSupports(function(layer) {
                    var supportsValueAxis = layer.getCartesianVisualCapabilities().supportsValueAxis;
                    return void 0 === supportsValueAxis || supportsValueAxis;
                }, dataViews, layers, layerIndex);
            }, CartesianChart.supportsDataBoundReferenceLines = function(dataViews, layers, layerIndex) {
                return CartesianChart.allLayerSupports(function(layer) {
                    return !layer.isStacked || !layer.isStacked();
                }, dataViews, layers, layerIndex);
            }, CartesianChart.allLayerSupports = function(predicate, dataViews, layers, layerIndex) {
                var layerDataViews = CartesianChart.getLayerDataViews(dataViews);
                if (_.isEmpty(layers)) return !1;
                var layerIndices = null == layerIndex ? layers : [ layers[layerIndex] ];
                return _.all(layerIndices, function(layer, index) {
                    return !layerDataViews[index] || predicate(layer);
                });
            }, CartesianChart.prototype.shouldShowLegendCard = function() {
                var layers = this.layers, dataViews = this.dataViews;
                if (layers && dataViews) for (var layersLength = layers.length, layersWithValuesCtr = 0, i = 0; i < layersLength; i++) {
                    if (layers[i].hasLegend()) return !0;
                    var dataView = dataViews[i];
                    if (dataView && dataView.categorical && dataView.categorical.values && dataView.categorical.values.length > 0 && (layersWithValuesCtr++, 
                    layersWithValuesCtr > 1)) return !0;
                }
                return !1;
            }, CartesianChart.prototype.getAxisScaleOptions = function(axisType) {
                var scaleOptions = [ visuals.DEFAULT_AXIS_SCALE_TYPE ];
                return this.axes.isLogScaleAllowed(axisType) && scaleOptions.push(visuals.axisScale.log), 
                scaleOptions;
            }, CartesianChart.prototype.enumerateCategoryAxis = function(enumeration) {
                if (this.originalCartesianData && this.originalCartesianData.axesData && this.originalCartesianData.axesData.isCategoryAxisSet) {
                    var categoryAxisData = this.originalCartesianData.axesData.categoryAxis, categoryAxisProps = visuals.cartesianChartProps.categoryAxis, isHierarchyRenderMode = 3 === this.categoryAxisRenderMode, supportedType = isHierarchyRenderMode ? visuals.axisType.categorical : visuals.axisType.both, isScalar = !1, scaleOptions = this.getAxisScaleOptions(0);
                    supportedType === visuals.axisType.both && this.layers && this.layers[0].getSupportedCategoryAxisType && (supportedType = this.layers[0].getSupportedCategoryAxisType(), 
                    supportedType === visuals.axisType.scalar ? isScalar = !0 : (isScalar = visuals.CartesianHelper.isScalar(supportedType === visuals.axisType.both, categoryAxisData), 
                    isScalar && (isScalar = 0 === this.categoryAxisRenderMode)));
                    var instance = {
                        selector: null,
                        properties: {},
                        objectName: "categoryAxis",
                        validValues: {
                            axisScale: scaleOptions,
                            axisStyle: this.axes.categoryAxisHasUnitType ? [ visuals.axisStyle.showTitleOnly, visuals.axisStyle.showUnitOnly, visuals.axisStyle.showBoth ] : [ visuals.axisStyle.showTitleOnly ]
                        },
                        propertyTypes: {}
                    };
                    if (instance.properties[categoryAxisProps.show.propertyName] = categoryAxisData.show, 
                    this.axes.isYAxisCategorical && (instance.properties[categoryAxisProps.position.propertyName] = categoryAxisData.position), 
                    supportedType === visuals.axisType.both && (instance.properties[categoryAxisProps.axisType.propertyName] = isScalar ? visuals.axisType.scalar : visuals.axisType.categorical), 
                    isScalar && (instance.properties[categoryAxisProps.axisScale.propertyName] = categoryAxisData.axisScale, 
                    instance.properties[categoryAxisProps.start.propertyName] = categoryAxisData.start, 
                    instance.properties[categoryAxisProps.end.propertyName] = categoryAxisData.end), 
                    instance.properties[categoryAxisProps.labelColor.propertyName] = visuals.AxisDataModel.toColorFill(categoryAxisData.labelFontProperties.color), 
                    this.axisControlImprovements && (instance.properties[categoryAxisProps.fontSize.propertyName] = categoryAxisData.labelFontProperties.size.px), 
                    this.customFontFamily && (instance.properties[categoryAxisProps.fontFamily.propertyName] = categoryAxisData.labelFontProperties.family), 
                    isScalar && (instance.properties[categoryAxisProps.labelDisplayUnits.propertyName] = categoryAxisData.labelDisplayUnits, 
                    instance.properties[categoryAxisProps.labelPrecision.propertyName] = categoryAxisData.labelPrecision), 
                    this.axes.isCategoryAxisDateTime() ? (instance.propertyTypes[categoryAxisProps.start.propertyName] = {
                        dateTime: !0
                    }, instance.propertyTypes[categoryAxisProps.end.propertyName] = {
                        dateTime: !0
                    }) : (instance.propertyTypes[categoryAxisProps.start.propertyName] = {
                        numeric: !0
                    }, instance.propertyTypes[categoryAxisProps.end.propertyName] = {
                        numeric: !0
                    }), this.axisControlImprovements && !isScalar && (instance.properties[categoryAxisProps.preferredCategoryWidth.propertyName] = categoryAxisData.preferredCategoryWidth), 
                    this.cartesianVisualCapabilities.supportsHierarchicalCategoryAxis && !isScalar) {
                        var concatenateLabelsName = categoryAxisProps.concatenateLabels.propertyName;
                        instance.properties[concatenateLabelsName] = categoryAxisData.concatenateLabels;
                    }
                    instance.properties[categoryAxisProps.showAxisTitle.propertyName] = categoryAxisData.showAxisTitle, 
                    instance.properties[categoryAxisProps.showAxisTitle.propertyName] && (instance.properties[categoryAxisProps.axisStyle.propertyName] = categoryAxisData.axisStyle, 
                    instance.properties[categoryAxisProps.titleColor.propertyName] = visuals.AxisDataModel.toColorFill(categoryAxisData.titleFontProperties.color), 
                    instance.properties[categoryAxisProps.titleText.propertyName] = categoryAxisData.titleText, 
                    this.axisControlImprovements && (instance.properties[categoryAxisProps.titleFontSize.propertyName] = categoryAxisData.titleFontProperties.size.px), 
                    this.customFontFamily && (instance.properties[categoryAxisProps.titleFontFamily.propertyName] = categoryAxisData.titleFontProperties.family)), 
                    (isScalar || isHierarchyRenderMode) && (instance.properties[categoryAxisProps.gridlineShow.propertyName] = categoryAxisData.gridlineShow, 
                    categoryAxisData.gridlineShow && (instance.properties[categoryAxisProps.gridlineColor.propertyName] = visuals.AxisDataModel.toColorFill(categoryAxisData.gridlineColor), 
                    instance.properties[categoryAxisProps.gridlineThickness.propertyName] = categoryAxisData.gridlineThickness, 
                    instance.validValues = {
                        gridlineThickness: [ "1", "2", "3", "4" ]
                    }, instance.properties[categoryAxisProps.gridlineStyle.propertyName] = categoryAxisData.gridlineStyle)), 
                    enumeration.pushInstance(instance);
                }
            }, CartesianChart.prototype.enumerateValueAxis = function(enumeration) {
                if (this.originalCartesianData && this.originalCartesianData.axesData && this.originalCartesianData.axesData.isValueAxisSet && !this.originalCartesianData.axesData.isValueAxisDisabled) {
                    var valueAxisData = this.originalCartesianData.axesData.valueAxis, valueAxisProps = visuals.cartesianChartProps.valueAxis, scaleOptions = this.getAxisScaleOptions(1), secScaleOption = this.getAxisScaleOptions(2), instance = {
                        selector: null,
                        properties: {},
                        objectName: "valueAxis",
                        validValues: {
                            axisScale: scaleOptions,
                            secAxisScale: secScaleOption,
                            axisStyle: this.axes.valueAxisHasUnitType ? [ visuals.axisStyle.showTitleOnly, visuals.axisStyle.showUnitOnly, visuals.axisStyle.showBoth ] : [ visuals.axisStyle.showTitleOnly ],
                            secAxisStyle: this.axes.secondaryValueAxisHasUnitType ? [ visuals.axisStyle.showTitleOnly, visuals.axisStyle.showUnitOnly, visuals.axisStyle.showBoth ] : [ visuals.axisStyle.showTitleOnly ]
                        },
                        propertyTypes: {}
                    };
                    instance.properties[valueAxisProps.show.propertyName] = valueAxisData.show, instance.properties[valueAxisProps.axisLabel.propertyName] = valueAxisData.axisLabel, 
                    this.axes.isYAxisCategorical || (instance.properties[valueAxisProps.position.propertyName] = valueAxisData.position), 
                    instance.properties[valueAxisProps.axisScale.propertyName] = valueAxisData.axisScale, 
                    instance.properties[valueAxisProps.start.propertyName] = valueAxisData.start, instance.properties[valueAxisProps.end.propertyName] = valueAxisData.end, 
                    instance.propertyTypes[valueAxisProps.start.propertyName] = {
                        numeric: !0
                    }, instance.propertyTypes[valueAxisProps.end.propertyName] = {
                        numeric: !0
                    }, instance.properties[valueAxisProps.labelColor.propertyName] = visuals.AxisDataModel.toColorFill(valueAxisData.labelFontProperties.color), 
                    this.axisControlImprovements && (instance.properties[valueAxisProps.fontSize.propertyName] = valueAxisData.labelFontProperties.size.px), 
                    this.customFontFamily && (instance.properties[valueAxisProps.fontFamily.propertyName] = valueAxisData.labelFontProperties.family), 
                    7 !== this.type && 8 !== this.type && (instance.properties[valueAxisProps.labelDisplayUnits.propertyName] = valueAxisData.labelDisplayUnits, 
                    instance.properties[valueAxisProps.labelPrecision.propertyName] = valueAxisData.labelPrecision), 
                    instance.properties[valueAxisProps.showAxisTitle.propertyName] = valueAxisData.showAxisTitle, 
                    instance.properties[valueAxisProps.showAxisTitle.propertyName] && (instance.properties[valueAxisProps.axisStyle.propertyName] = valueAxisData.axisStyle, 
                    instance.properties[valueAxisProps.titleColor.propertyName] = visuals.AxisDataModel.toColorFill(valueAxisData.titleFontProperties.color), 
                    instance.properties[valueAxisProps.titleText.propertyName] = valueAxisData.titleText, 
                    this.axisControlImprovements && (instance.properties[valueAxisProps.titleFontSize.propertyName] = valueAxisData.titleFontProperties.size.px), 
                    this.customFontFamily && (instance.properties[valueAxisProps.titleFontFamily.propertyName] = valueAxisData.titleFontProperties.family)), 
                    instance.properties[valueAxisProps.gridlineShow.propertyName] = valueAxisData.gridlineShow, 
                    valueAxisData.gridlineShow && (instance.properties[valueAxisProps.gridlineColor.propertyName] = visuals.AxisDataModel.toColorFill(valueAxisData.gridlineColor), 
                    instance.properties[valueAxisProps.gridlineThickness.propertyName] = valueAxisData.gridlineThickness, 
                    instance.validValues = {
                        gridlineThickness: [ "1", "2", "3", "4" ]
                    }, instance.properties[valueAxisProps.gridlineStyle.propertyName] = valueAxisData.gridlineStyle);
                    var y2AxisData = this.originalCartesianData.axesData.y2;
                    2 === this.layers.length && (instance.properties[valueAxisProps.secShow.propertyName] = void 0 !== y2AxisData.show ? y2AxisData.show : this.axes.hasY2Axis()), 
                    this.axes.hasY2Axis() && instance.properties[valueAxisProps.secShow.propertyName] && (instance.properties[valueAxisProps.alignZeros.propertyName] = valueAxisData.alignZeros, 
                    instance.properties.secAxisLabel = "", instance.properties[valueAxisProps.secPosition.propertyName] = y2AxisData.position, 
                    instance.properties[valueAxisProps.secAxisScale.propertyName] = y2AxisData.axisScale, 
                    instance.properties[valueAxisProps.secStart.propertyName] = y2AxisData.start, instance.properties[valueAxisProps.secEnd.propertyName] = y2AxisData.end, 
                    instance.propertyTypes[valueAxisProps.secStart.propertyName] = {
                        numeric: !0
                    }, instance.propertyTypes[valueAxisProps.secEnd.propertyName] = {
                        numeric: !0
                    }, instance.properties[valueAxisProps.secLabelColor.propertyName] = visuals.AxisDataModel.toColorFill(y2AxisData.labelFontProperties.color), 
                    this.axisControlImprovements && (instance.properties[valueAxisProps.secFontSize.propertyName] = y2AxisData.labelFontProperties.size.px), 
                    this.customFontFamily && (instance.properties[valueAxisProps.secFontFamily.propertyName] = y2AxisData.labelFontProperties.family), 
                    instance.properties[valueAxisProps.secLabelDisplayUnits.propertyName] = y2AxisData.labelDisplayUnits, 
                    instance.properties[valueAxisProps.secLabelPrecision.propertyName] = y2AxisData.labelPrecision, 
                    instance.properties[valueAxisProps.secShowAxisTitle.propertyName] = y2AxisData.showAxisTitle, 
                    instance.properties[valueAxisProps.secShowAxisTitle.propertyName] && (instance.properties[valueAxisProps.secAxisStyle.propertyName] = y2AxisData.axisStyle, 
                    instance.properties[valueAxisProps.secTitleColor.propertyName] = visuals.AxisDataModel.toColorFill(y2AxisData.titleFontProperties.color), 
                    instance.properties[valueAxisProps.secTitleText.propertyName] = y2AxisData.titleText, 
                    this.axisControlImprovements && (instance.properties[valueAxisProps.secTitleFontSize.propertyName] = y2AxisData.titleFontProperties.size.px), 
                    this.customFontFamily && (instance.properties[valueAxisProps.secTitleFontFamily.propertyName] = y2AxisData.titleFontProperties.family))), 
                    enumeration.pushInstance(instance);
                }
            }, CartesianChart.prototype.onClearSelection = function() {
                if (this.hasSetData) for (var i = 0, len = this.layers.length; i < len; i++) {
                    var layer = this.layers[i];
                    layer.onClearSelection(), layer.render(!0);
                }
            }, CartesianChart.prototype.extractMetadataObjects = function(dataViews) {
                var objects;
                if (dataViews && dataViews.length > 0) {
                    var dataViewMetadata = dataViews[0].metadata;
                    dataViewMetadata && (objects = dataViewMetadata.objects);
                }
                return objects;
            }, CartesianChart.prototype.createAndInitLayers = function(objects) {
                var _this = this, factory = new CartesianLayerFactory(this.viewModelAdapter), layers = factory.createLayers({
                    type: this.type,
                    objects: objects,
                    interactivityService: this.interactivityService,
                    animator: this.animator,
                    isScrollable: this.axes.isScrollable,
                    tooltipsEnabled: this.tooltipsEnabled,
                    featureSwitches: {
                        axisControlImprovements: this.axisControlImprovements,
                        binnedLineSamplingSupported: this.binnedLineSampling,
                        customFontFamilyForDataLabel: this.customFontFamilyForDataLabel,
                        scatterWithMatrixDV: this.scatterWithMatrixDV,
                        scatterWithDataVolume: this.scatterWithDataVolume,
                        lineMarkersEnabled: this.lineMarkersEnabled,
                        waterfallBreakdown: this.waterfallBreakdown,
                        lineStylesEnabled: this.lineStylesEnabled
                    }
                }), cartesianOptions = powerbi.Prototype.inherit(this.visualInitOptions);
                cartesianOptions.svg = this.svgAxes.getScrollableRegion(), cartesianOptions.labelsContext = this.svgAxes.getLabelsRegion(), 
                cartesianOptions.cartesianHost = {
                    updateLegend: function(data) {
                        return _this.legend.drawLegend(data, _this.currentViewport);
                    },
                    triggerRender: function(suppressAnimations) {
                        return _this.render(suppressAnimations);
                    }
                }, cartesianOptions.chartType = this.type, cartesianOptions.services = {
                    tooltips: this.tooltipService
                }, cartesianOptions.style = this.layerStyle;
                for (var i = 0, len = layers.length; i < len; i++) layers[i].init(cartesianOptions);
                return layers;
            }, CartesianChart.prototype.renderLegend = function() {
                var legendData = powerbi.Prototype.inherit(this.cartesianData.legendData);
                null != legendData.position ? this.legend.changeOrientation(legendData.position) : this.legend.changeOrientation(visuals.LegendPosition.Top), 
                (1 === legendData.dataPoints.length && !legendData.grouped || this.hideLegends()) && (legendData.dataPoints = []), 
                this.legend.drawLegend(legendData, this.currentViewport);
            }, CartesianChart.prototype.hideLegends = function() {
                if (this.cartesianData.allowSmallViewport && this.cartesianSmallViewPortProperties) {
                    var position = this.legend.getOrientation(), isSmallViewportWidth = this.currentViewport.width <= this.cartesianSmallViewPortProperties.minWidthForLegend && visuals.Legend.isLeftOrRight(position), isSmallViewportHeight = this.currentViewport.height <= this.cartesianSmallViewPortProperties.minHeightForLegend && visuals.Legend.isTopOrBottom(position);
                    return isSmallViewportWidth || isSmallViewportHeight;
                }
                return !1;
            }, CartesianChart.prototype.isSideLegendExists = function() {
                return this.legend.isVisible() && visuals.Legend.isLeftOrRight(this.legend.getOrientation());
            }, CartesianChart.prototype.render = function(suppressAnimations, resizeMode, operationKind) {
                this.cartesianData.showIcon ? this.visibilityHelper.updateVisibility({
                    showIcon: this.cartesianData.showIcon,
                    viewport: this.currentViewport
                }) : (this.visibilityHelper.updateVisibility({
                    showIcon: this.cartesianData.showIcon
                }), this.renderCartesianChart(suppressAnimations, resizeMode, operationKind));
            }, CartesianChart.prototype.renderCartesianChart = function(suppressAnimations, resizeMode, operationKind) {
                var _this = this;
                this.visualInitOptions.interactivity && this.visualInitOptions.interactivity.isInteractiveLegend || this.renderLegend();
                var playAxisControlLayout, legendMargins = this.legendMargins = this.legend.getMargins(), legendOrientation = this.legend.getOrientation(), showAxisTitles = this.showAxisTitles(this.cartesianData.axesData), shouldRenderAxis = this.shouldRenderAxis(this.cartesianData.axesData), axesFontProperties = this.getAxesFontProperties(), chartAreaViewport = {
                    height: this.currentViewport.height - legendMargins.height,
                    width: this.currentViewport.width - legendMargins.width
                }, padding = powerbi.Prototype.inherit(visuals.SvgCartesianAxes.AxisPadding);
                this.isPlayAxis() && (chartAreaViewport.height -= CartesianChart.PlayAxisBottomMargin, 
                playAxisControlLayout = {
                    left: visuals.Legend.isLeft(legendOrientation) ? legendMargins.width : 0,
                    top: visuals.Legend.isTop(legendOrientation) ? legendMargins.height + chartAreaViewport.height : chartAreaViewport.height,
                    height: CartesianChart.PlayAxisBottomMargin,
                    width: chartAreaViewport.width
                }), this.chartAreaSvg.attr({
                    width: chartAreaViewport.width,
                    height: chartAreaViewport.height
                }), visuals.Legend.positionChartArea(this.chartAreaSvg, this.legend);
                var interactivityRightMargin = this.calculateInteractivityRightMargin(), _a = this.getMinimumDomainExtents(), ensureXDomain = _a[0], ensureYDomain = _a[1], plotAreaHasChanged = !this.renderedPlotArea || this.renderedPlotArea.height !== chartAreaViewport.height || this.renderedPlotArea.width !== chartAreaViewport.width;
                suppressAnimations = suppressAnimations || plotAreaHasChanged;
                var axesLayout = this.axes.negotiateAxes(this.layers, chartAreaViewport, padding, playAxisControlLayout, showAxisTitles, shouldRenderAxis, axesFontProperties, interactivityRightMargin, ensureXDomain, ensureYDomain), categoryAxis = axesLayout.axes.x.isCategoryAxis ? axesLayout.axes.x : axesLayout.axes.y1;
                if (this.loadMoreDataHandler && this.loadMoreDataHandler.setScale(categoryAxis.scale), 
                this.lassoSelectionBehavior && this.lassoSelectionBehavior.update(axesLayout), this.renderedPlotArea = chartAreaViewport, 
                !(axesLayout.plotArea.width < 1 || axesLayout.plotArea.height < 1)) {
                    var layers = this.layers, renderDelegate = function(layers, axesLayout, suppressAnimations, animateCategoryAxis, animateValueAxis) {
                        return _this.renderPlotArea(layers, axesLayout, suppressAnimations, legendMargins, axesFontProperties, resizeMode, animateCategoryAxis, animateValueAxis);
                    }, loadMoreDataHandler = this.loadMoreDataHandler, preserveScrollPosition = operationKind === powerbi.VisualDataChangeOperationKind.Append || null != resizeMode;
                    this.scrollableAxes.render(axesLayout, layers, suppressAnimations, renderDelegate, loadMoreDataHandler, preserveScrollPosition), 
                    this.bindScrollWheelEvents(axesLayout, this.chartAreaSvg), this.bindTouchEvents(axesLayout, this.chartAreaSvg);
                }
            }, CartesianChart.prototype.getMinimumDomainExtents = function() {
                var xs = [], ys = [];
                visuals.ReferenceLineHelper.gatherDomainExtents(this.cartesianData.referenceLines, xs, ys);
                var ensureXDomain = {
                    min: d3.min(xs),
                    max: d3.max(xs)
                }, ensureYDomain = {
                    min: d3.min(ys),
                    max: d3.max(ys)
                };
                return [ ensureXDomain, ensureYDomain ];
            }, CartesianChart.prototype.getPlotAreaRect = function(axesLayout, legendMargins) {
                var rect = {
                    left: axesLayout.margin.left,
                    top: axesLayout.margin.top,
                    width: axesLayout.plotArea.width,
                    height: axesLayout.plotArea.height
                };
                if (this.legend) {
                    var legendPosition_1 = this.legend.getOrientation();
                    visuals.Legend.isTop(legendPosition_1) ? rect.top += legendMargins.height : visuals.Legend.isLeft(legendPosition_1) && (rect.left += legendMargins.width);
                }
                return rect;
            }, CartesianChart.prototype.renderBackgroundImage = function(layout) {
                visuals.visualBackgroundHelper.renderBackgroundImage(this.background, this.element, layout);
            }, CartesianChart.prototype.showAxisTitles = function(axesData) {
                var showAxisTitles = {
                    x: axesData.x.showAxisTitle,
                    y: axesData.y.showAxisTitle,
                    y2: axesData.y2.showAxisTitle
                };
                return this.cartesianData.allowSmallViewport && this.cartesianSmallViewPortProperties && (this.currentViewport.height <= this.cartesianSmallViewPortProperties.minHeightForAxisLabels && (showAxisTitles.x = !1, 
                showAxisTitles.y = !1, showAxisTitles.y2 = !1), this.currentViewport.width <= this.cartesianSmallViewPortProperties.minWidthForAxisLabels && (showAxisTitles.y = !1, 
                showAxisTitles.y2 = !1)), showAxisTitles;
            }, CartesianChart.prototype.shouldRenderAxis = function(axesData) {
                var shouldRenderAxis = {
                    x: axesData.x.show,
                    y: axesData.y.show,
                    y2: axesData.y2.show !== !1
                };
                return this.cartesianData.allowSmallViewport && this.cartesianSmallViewPortProperties && (this.currentViewport.height <= this.cartesianSmallViewPortProperties.minHeightForAxis && (shouldRenderAxis.x = !1), 
                this.currentViewport.width <= this.cartesianSmallViewPortProperties.minWidthForAxis && (shouldRenderAxis.y = !1, 
                shouldRenderAxis.y2 = !1), this.currentViewport.width <= this.cartesianSmallViewPortProperties.mediumWidthForAxis && this.isSideLegendExists() && (shouldRenderAxis.y = !1, 
                shouldRenderAxis.y2 = !1)), shouldRenderAxis;
            }, CartesianChart.prototype.getAxesFontProperties = function() {
                var xAxisData = this.cartesianData.axesData.x, xAxisFontProperties = {
                    tickLabels: xAxisData.labelFontProperties,
                    title: xAxisData.titleFontProperties
                }, yAxisData = this.cartesianData.axesData.y, yAxisFontProperties = {
                    tickLabels: yAxisData.labelFontProperties,
                    title: yAxisData.titleFontProperties
                }, secAxisData = this.cartesianData.axesData.y2, secAxisFontProperties = {
                    tickLabels: secAxisData.labelFontProperties,
                    title: secAxisData.titleFontProperties
                }, fontProperties = {
                    x: xAxisFontProperties,
                    y: yAxisFontProperties,
                    y2: secAxisFontProperties
                };
                if (this.cartesianData.allowSmallViewport && this.cartesianSmallViewPortProperties && this.currentViewport.width <= this.cartesianSmallViewPortProperties.maxWidthForMediumFont) {
                    var newSizesPx = {
                        x: {
                            tickLabels: CartesianChart.xAxisSmallFontSizeInPx,
                            title: CartesianChart.xAxisSmallFontSizeInPx
                        },
                        y: {
                            tickLabels: CartesianChart.yAxisMediumFontSizeInPx,
                            title: CartesianChart.yAxisMediumFontSizeInPx
                        },
                        y2: {
                            tickLabels: CartesianChart.yAxisMediumFontSizeInPx,
                            title: CartesianChart.yAxisMediumFontSizeInPx
                        }
                    };
                    this.currentViewport.width <= this.cartesianSmallViewPortProperties.maxWidthForSmallFont && (newSizesPx.y.tickLabels = CartesianChart.yAxisSmallFontSizeInPx, 
                    newSizesPx.y.title = CartesianChart.yAxisSmallFontSizeInPx, newSizesPx.y2.tickLabels = CartesianChart.yAxisSmallFontSizeInPx, 
                    newSizesPx.y2.title = CartesianChart.yAxisSmallFontSizeInPx), fontProperties.x.tickLabels = visuals.FontProperties.inherit(fontProperties.x.tickLabels, {
                        size: FontSize.createFromPx(newSizesPx.x.tickLabels)
                    }), fontProperties.x.title = visuals.FontProperties.inherit(fontProperties.x.title, {
                        size: FontSize.createFromPx(newSizesPx.x.title)
                    }), fontProperties.y.tickLabels = visuals.FontProperties.inherit(fontProperties.y.tickLabels, {
                        size: FontSize.createFromPx(newSizesPx.y.tickLabels)
                    }), fontProperties.y.title = visuals.FontProperties.inherit(fontProperties.y.title, {
                        size: FontSize.createFromPx(newSizesPx.y.title)
                    }), fontProperties.y2.tickLabels = visuals.FontProperties.inherit(fontProperties.y2.tickLabels, {
                        size: FontSize.createFromPx(newSizesPx.y2.tickLabels)
                    }), fontProperties.y2.title = visuals.FontProperties.inherit(fontProperties.y2.title, {
                        size: FontSize.createFromPx(newSizesPx.y2.title)
                    });
                }
                return fontProperties;
            }, CartesianChart.prototype.calculateInteractivityRightMargin = function() {
                return this.visualInitOptions.interactivity && this.visualInitOptions.interactivity.isInteractiveLegend && !this.trimOrdinalDataOnOverflow ? INTERACTIVITY_RIGHT_MARGIN : 0;
            }, CartesianChart.prototype.renderPlotArea = function(layers, axesLayout, suppressAnimations, legendMargins, axesFontProperties, resizeMode, animateCategoryAxis, animateValueAxis) {
                suppressAnimations = suppressAnimations || _.any(layers, function(layer) {
                    return layer.shouldSuppressAnimation && layer.shouldSuppressAnimation();
                });
                var axes = axesLayout.axes, plotArea = axesLayout.plotArea, plotAreaRect = this.getPlotAreaRect(axesLayout, legendMargins), duration = visuals.AnimatorCommon.GetAnimationDuration(this.animator, suppressAnimations), easing = this.animator && this.animator.getEasing();
                this.renderBackgroundImage(plotAreaRect), this.svgAxes.renderAxes({
                    axesLayout: axesLayout,
                    duration: duration,
                    axesFontProperties: axesFontProperties,
                    animateCategoryAxis: animateCategoryAxis,
                    animateValueAxis: animateValueAxis,
                    easing: _.isEmpty(easing) ? void 0 : easing
                }), this.renderReferenceLines(axesLayout), this.renderLayers(layers, plotArea, axes, suppressAnimations, resizeMode), 
                this.renderTrendLines(axesLayout);
            }, CartesianChart.prototype.renderTrendLines = function(axesLayout) {
                var scrollableRegion = this.svgAxes.getScrollableRegion();
                visuals.TrendLineHelper.render(this.cartesianData.trendLines, scrollableRegion, axesLayout.axes, axesLayout.plotArea);
            }, CartesianChart.prototype.renderReferenceLines = function(axesLayout) {
                var refLineOptions = {
                    graphicContext: this.svgAxes.getScrollableRegion(),
                    axes: axesLayout.axes,
                    viewport: axesLayout.plotArea,
                    referenceLines: this.cartesianData.referenceLines
                };
                visuals.ReferenceLineHelper.render(refLineOptions);
            }, CartesianChart.prototype.getReferenceLineLabels = function(axes, plotArea) {
                var dataLabelOptions = {
                    axes: axes,
                    viewport: plotArea,
                    referenceLines: this.cartesianData.referenceLines,
                    hostServices: this.hostServices
                };
                return visuals.ReferenceLineHelper.createLabelDataPoint(dataLabelOptions);
            }, CartesianChart.prototype.renderDataLabels = function(labelDataPointGroups, labelsAreNumeric, plotArea, suppressAnimations, isCombo, animateLabels) {
                var labelBackgroundRegion = this.svgAxes.getLabelBackground(), labelRegion = this.svgAxes.getLabelsRegion(), dataLabels = [];
                if (this.behavior) {
                    var labelLayoutOptions = visuals.LabelUtils.getDataLabelLayoutOptions(this.type), labelLayout = new powerbi.LabelLayout(labelLayoutOptions);
                    dataLabels = labelLayout.layout(labelDataPointGroups, plotArea), isCombo && visuals.LabelUtils.drawLabelBackground(labelBackgroundRegion, dataLabels, "#FFFFFF", .7);
                    var svgLabels = void 0, animator = this.animator;
                    if (animator && !suppressAnimations && animateLabels) {
                        var isPlayAxis = this.isPlayAxis(), duration = isPlayAxis ? visuals.PlayChart.FrameAnimationDuration : animator.getDuration();
                        svgLabels = visuals.LabelUtils.animateDefaultLabels(labelRegion, dataLabels, duration, labelsAreNumeric, isPlayAxis ? "linear" : animator.getEasing());
                    } else svgLabels = visuals.LabelUtils.drawDefaultLabels(labelRegion, dataLabels, labelsAreNumeric);
                    if (labelLayoutOptions.allowLeaderLines) {
                        var filteredLabels = _.filter(dataLabels, function(d) {
                            return null != d.leaderLinePoints && !_.isEmpty(d.leaderLinePoints) && null != d.identity;
                        });
                        visuals.LabelUtils.drawLabelLeaderLines(labelRegion, filteredLabels, function(d) {
                            return d.identity.getKey();
                        });
                    }
                    if (this.interactivityService && this.isLabelInteractivityEnabled) {
                        var labelsBehaviorOptions = {
                            labelItems: svgLabels
                        };
                        this.interactivityService.bind(dataLabels, new visuals.LabelsBehavior(), labelsBehaviorOptions, {
                            isLabels: !0
                        });
                    }
                } else {
                    var labelLayout = new powerbi.LabelLayout({
                        maximumOffset: visuals.LabelUtils.maxLabelOffset,
                        startingOffset: visuals.LabelUtils.startingLabelOffset,
                        attemptToMoveLabelsIntoViewport: !0
                    });
                    dataLabels = labelLayout.layout(labelDataPointGroups, plotArea), isCombo && visuals.LabelUtils.drawLabelBackground(labelBackgroundRegion, dataLabels, "#FFFFFF", .7), 
                    visuals.LabelUtils.drawDefaultLabels(labelRegion, dataLabels, labelsAreNumeric);
                }
                for (var hasLabelDataPoint, _i = 0, labelDataPointGroups_1 = labelDataPointGroups; _i < labelDataPointGroups_1.length; _i++) {
                    var labelDataPointGroup = labelDataPointGroups_1[_i];
                    if (!_.isEmpty(labelDataPointGroup.labelDataPoints)) {
                        hasLabelDataPoint = !0;
                        break;
                    }
                }
                return !_.isEmpty(dataLabels) || !hasLabelDataPoint;
            }, CartesianChart.prototype.renderLayers = function(layers, plotArea, axes, suppressAnimations, resizeMode) {
                var labelDataPointGroups = [], dataPoints = [], layerBehaviorOptions = [], labelsAreNumeric = !0;
                suppressAnimations = suppressAnimations || _.any(layers, function(layer) {
                    return layer.shouldSuppressAnimation && layer.shouldSuppressAnimation();
                });
                for (var animateLabels = !0, _i = 0, layers_1 = layers; _i < layers_1.length; _i++) {
                    var layer = layers_1[_i], result = layer.render(suppressAnimations, resizeMode);
                    if (result) {
                        if (result.animateLabels || (animateLabels = !1), this.behavior && (dataPoints = dataPoints.concat(result.dataPoints), 
                        layerBehaviorOptions.push(result.behaviorOptions)), result.labelDataPointGroups) for (var resultLabelDataPointsGroups = result.labelDataPointGroups, _a = 0, resultLabelDataPointsGroups_1 = resultLabelDataPointsGroups; _a < resultLabelDataPointsGroups_1.length; _a++) {
                            var resultLabelDataPointsGroup = resultLabelDataPointsGroups_1[_a];
                            resultLabelDataPointsGroup && labelDataPointGroups.push({
                                labelDataPoints: visuals.LabelUtils.removeDuplicates(resultLabelDataPointsGroup.labelDataPoints || []),
                                maxNumberOfLabels: resultLabelDataPointsGroup.maxNumberOfLabels,
                                labelOrientation: result.labelOrientation
                            });
                        } else {
                            var resultsLabelDataPoints = result.labelDataPoints || [];
                            labelDataPointGroups.push({
                                labelDataPoints: visuals.LabelUtils.removeDuplicates(resultsLabelDataPoints),
                                maxNumberOfLabels: resultsLabelDataPoints.length,
                                labelOrientation: result.labelOrientation
                            });
                        }
                        labelsAreNumeric = labelsAreNumeric && result.labelsAreNumeric;
                    }
                }
                var referenceLineLabels = this.getReferenceLineLabels(axes, plotArea);
                if (_.isEmpty(referenceLineLabels) || labelDataPointGroups.unshift({
                    labelDataPoints: referenceLineLabels,
                    maxNumberOfLabels: referenceLineLabels.length
                }), this.noLabelsCanBeRendered = !this.renderDataLabels(labelDataPointGroups, labelsAreNumeric, plotArea, suppressAnimations, visuals.ComboChart.isComboChart(this.type), animateLabels), 
                this.interactivityService) {
                    var behaviorOptions = {
                        layerOptions: layerBehaviorOptions,
                        clearCatcher: this.clearCatcher
                    };
                    this.interactivityService.bind(dataPoints, this.behavior, behaviorOptions);
                }
            }, CartesianChart.getPreferredPlotArea = function(categoryCount, categoryThickness, viewport, isScrollable, isScalar, margin, outerPaddingRatio) {
                margin || (margin = {
                    top: 0,
                    right: 0,
                    bottom: 0,
                    left: 0
                });
                var plotArea = {
                    height: viewport.height - margin.top - margin.bottom,
                    width: viewport.width - margin.left - margin.right
                };
                if (!isScalar && isScrollable) {
                    var preferredCategorySpan = CartesianChart.getPreferredCategorySpan(categoryCount, categoryThickness, outerPaddingRatio);
                    plotArea.width = Math.max(preferredCategorySpan, plotArea.width);
                }
                return plotArea;
            }, CartesianChart.getPreferredCategorySpan = function(categoryCount, categoryThickness, outerPaddingRatio) {
                var span = categoryThickness * categoryCount;
                return span + categoryThickness * (outerPaddingRatio || 0) * 2;
            }, CartesianChart.getLayout = function(data, options) {
                var categoryCount = options.categoryCount, availableWidth = options.availableWidth, isScalar = !!options.isScalar, isScrollable = !!options.isScrollable, defaultCategoryThickness = CartesianChart.getCategoryWidth(data ? data.series : null, options), categoryWidthInfo = CartesianChart.getCustomizedCategoryWidthInfo(defaultCategoryThickness, options), categoryWidth = categoryWidthInfo.categoryWidth, outerPaddingRatio = categoryWidthInfo.outerPaddingRatio, totalOuterPadding = categoryWidth * outerPaddingRatio * 2, calculatedBarCount = powerbi.Double.floorWithPrecision((availableWidth - totalOuterPadding) / categoryWidth), visibleCategoryCount = Math.min(calculatedBarCount, categoryCount), willScroll = visibleCategoryCount < categoryCount && isScrollable;
                if (!isScalar && !willScroll) {
                    var oneOuterPadding = (availableWidth - categoryWidth * visibleCategoryCount) / 2;
                    outerPaddingRatio = Math.max(0, oneOuterPadding / categoryWidth), outerPaddingRatio = powerbi.Double.equalWithPrecision(outerPaddingRatio, 0) ? 0 : outerPaddingRatio;
                }
                return !isScalar && isScrollable && (visibleCategoryCount = categoryCount), {
                    categoryCount: visibleCategoryCount,
                    categoryThickness: categoryWidth,
                    outerPaddingRatio: outerPaddingRatio,
                    innerPaddingRatio: options.innerPaddingRatio,
                    isScalar: isScalar
                };
            }, CartesianChart.getCustomizedCategoryWidthInfo = function(defaultCategoryThickness, options) {
                var categoryWidth = defaultCategoryThickness, categoryCount = options.categoryCount, availableWidth = options.availableWidth, isScalar = options.isScalar, preferredCategoryWidth = options.preferredCategoryWidth, outerPaddingRatio = options.outerPaddingRatio;
                if (isScalar || null == preferredCategoryWidth || preferredCategoryWidth < defaultCategoryThickness) return {
                    categoryWidth: categoryWidth,
                    outerPaddingRatio: outerPaddingRatio
                };
                var numberCategoriesCanShow = Math.floor((availableWidth - preferredCategoryWidth * outerPaddingRatio * 2) / preferredCategoryWidth);
                return numberCategoriesCanShow <= 0 ? categoryWidth = availableWidth / (1 + 2 * outerPaddingRatio) : numberCategoriesCanShow < categoryCount ? (outerPaddingRatio = (availableWidth - preferredCategoryWidth * numberCategoriesCanShow) / (2 * preferredCategoryWidth), 
                categoryWidth = preferredCategoryWidth) : categoryWidth = Math.min(preferredCategoryWidth, availableWidth), 
                {
                    categoryWidth: categoryWidth,
                    outerPaddingRatio: outerPaddingRatio
                };
            }, CartesianChart.getCategoryWidth = function(seriesList, options) {
                var categoryWidth, numCategories = options.categoryCount, plotLength = options.availableWidth, domain = options.domain, isScalar = options.isScalar, trimOrdinalDataOnOverflow = options.trimOrdinalDataOnOverflow, outerPaddingRatio = options.outerPaddingRatio;
                if (numCategories < 2) categoryWidth = plotLength * (1 - outerPaddingRatio); else if (isScalar && domain && domain.length > 1) {
                    var minInterval = CartesianChart.getMinInterval(seriesList), domainSpan = domain[domain.length - 1] - domain[0], ratio = minInterval / (domainSpan + minInterval * outerPaddingRatio * 2);
                    categoryWidth = plotLength * ratio, categoryWidth = Math.max(categoryWidth, CartesianChart.MinScalarRectThickness);
                } else categoryWidth = plotLength / (numCategories + 2 * outerPaddingRatio), trimOrdinalDataOnOverflow && (categoryWidth = Math.max(categoryWidth, visuals.CartesianHelper.MinOrdinalRectThickness));
                var maxRectWidth = plotLength / (3 + 2 * outerPaddingRatio);
                return categoryWidth = Math.min(categoryWidth, maxRectWidth), !isScalar && numCategories >= 3 && trimOrdinalDataOnOverflow ? Math.max(categoryWidth, visuals.CartesianHelper.MinOrdinalRectThickness) : categoryWidth;
            }, CartesianChart.getMinInterval = function(seriesList) {
                var minInterval = Number.MAX_VALUE;
                if (seriesList.length > 0) for (var series0data = seriesList[0].data.filter(function(d) {
                    return !d.highlight;
                }), i = 0, ilen = series0data.length - 1; i < ilen; i++) minInterval = Math.min(minInterval, Math.abs(series0data[i + 1].categoryValue - series0data[i].categoryValue));
                return minInterval;
            }, CartesianChart.getLayerDataViews = function(dataViews) {
                return _.isEmpty(dataViews) ? [] : _.filter(dataViews, function(dataView) {
                    return !visuals.TrendLineHelper.isDataViewForRegression(dataView) && !visuals.ForecastHelper.isDataViewForForecast(dataView);
                });
            }, CartesianChart.MinScalarRectThickness = 2, CartesianChart.LoadMoreThreshold = 1, 
            CartesianChart.xAxisSmallFontSizeInPx = 9, CartesianChart.yAxisSmallFontSizeInPx = 9, 
            CartesianChart.yAxisMediumFontSizeInPx = 11, CartesianChart.ClassName = "cartesianChart", 
            CartesianChart.IconClassName = "cartesianChartResponsiveIcon", CartesianChart.PlayAxisBottomMargin = 80, 
            CartesianChart;
        }();
        visuals.CartesianChart = CartesianChart;
        var CartesianAxisRenderModeSelector = function() {
            function CartesianAxisRenderModeSelector(dataView, supportsHierarchicalCategoryAxis) {
                this.processDataView(dataView, supportsHierarchicalCategoryAxis);
            }
            return CartesianAxisRenderModeSelector.prototype.processDataView = function(dataView, supportsHierarchicalCategoryAxis) {
                if (this.renderModes = [], !dataView || !dataView.metadata || !dataView.categorical || _.isEmpty(dataView.categorical.categories)) return void this.renderModes.push(2);
                var metadata = dataView.metadata, categories = dataView.categorical.categories, categoryColumn = _.first(categories), scalarKeys = visuals.ScalarUtils.getScalarKeys(categoryColumn), hasHierarchy = visuals.CartesianHelper.hasCategoryHierarchy(dataView), shouldDrawScalar = visuals.ScalarUtils.shouldDrawScalar(metadata.objects, visuals.columnChartProps.categoryAxis.axisType, categoryColumn.source.type, scalarKeys, hasHierarchy);
                if (hasHierarchy) {
                    var filteredToUniqueValue = CartesianAxisRenderModeSelector.areNonLeafLevelsFilteredToUniqueValue(categories), concatenateLabelsEnabled = powerbi.DataViewObjects.getValue(metadata.objects, visuals.cartesianChartProps.categoryAxis.concatenateLabels, visuals.CartesianHelper.DefaultConcatenateLabelsValue);
                    if (filteredToUniqueValue && concatenateLabelsEnabled) this.renderModes.unshift(1); else {
                        var sortCompatible = CartesianAxisRenderModeSelector.isSortedByCategoryFirst(dataView), hasIdentityExprs = _.any(dataView.categorical.categories, function(category) {
                            return category.source && category.source.identityExprs;
                        }), canDrawHierarchy = supportsHierarchicalCategoryAxis && !concatenateLabelsEnabled && hasIdentityExprs && (sortCompatible || filteredToUniqueValue);
                        this.renderModes.unshift(2), canDrawHierarchy && this.renderModes.unshift(3), concatenateLabelsEnabled || hasIdentityExprs || (this.warnings = [ {
                            selector: null,
                            warnings: [ new visuals.NoIdentityExprWarning() ]
                        } ]);
                    }
                    shouldDrawScalar && this.renderModes.unshift(0);
                } else this.renderModes.unshift(1), shouldDrawScalar && this.renderModes.unshift(0);
            }, CartesianAxisRenderModeSelector.prototype.getRenderMode = function() {
                return _.first(this.renderModes);
            }, CartesianAxisRenderModeSelector.prototype.getRenderModes = function() {
                return this.renderModes;
            }, CartesianAxisRenderModeSelector.prototype.addObjectWarnings = function(warnings) {
                this.warnings && warnings.push.apply(warnings, this.warnings);
            }, CartesianAxisRenderModeSelector.isSortedByCategoryFirst = function(dataView) {
                return !(!dataView || !dataView.categorical || _.isEmpty(dataView.categorical.categories) || !dataView.metadata || _.isEmpty(dataView.metadata.columns)) && _.all(dataView.categorical.categories, function(category, index) {
                    var metadata = category.source;
                    return metadata && null != metadata.sort && metadata.sortOrder === index;
                });
            }, CartesianAxisRenderModeSelector.areNonLeafLevelsFilteredToUniqueValue = function(categories) {
                if (_.isEmpty(categories)) return !1;
                for (var leafCategoryColumnIndex = categories.length - 1, categoryColumnIndex = 0; categoryColumnIndex < leafCategoryColumnIndex; categoryColumnIndex++) {
                    var metadata = categories[categoryColumnIndex].source;
                    if (!metadata || !powerbi.DataViewObjects.getValue(metadata.objects, visuals.cartesianChartProps.filters.filteredToUniqueValue, !1)) return !1;
                }
                return !0;
            }, CartesianAxisRenderModeSelector;
        }();
        visuals.CartesianAxisRenderModeSelector = CartesianAxisRenderModeSelector;
        var ScrollableAxes = function() {
            function ScrollableAxes(axes, svgScrollbar, animateCategoryAxis, animateValueAxis) {
                this.cartesianAxes = axes, this.scrollbar = svgScrollbar, this.animateCategoryAxis = animateCategoryAxis, 
                this.animateValueAxis = animateValueAxis;
            }
            return ScrollableAxes.filterDataToViewport = function(options) {
                if (options && options.scrollScale) {
                    var selected, scrollScale = options.scrollScale, mainAxisScale = options.mainAxisScale, data = [], startIndex = visuals.AxisHelper.invertOrdinalScale(scrollScale, options.extent.start), endIndex = startIndex + options.visibleCategoryCount, domain = scrollScale.domain();
                    if (selected = domain.slice(startIndex, endIndex), !_.isEqual(selected, mainAxisScale.domain())) {
                        if (selected && selected.length > 0) {
                            for (var layers = options.layers, i = 0; i < layers.length; i++) data[i] = layers[i].setFilteredData(selected[0], selected[selected.length - 1] + 1);
                            mainAxisScale.domain(selected);
                            var axisProperties = options.axesLayout.axes, axisPropsToUpdate = void 0;
                            axisPropsToUpdate = options.axesLayout.isXScrollBarVisible ? axisProperties.x : axisProperties.y1, 
                            axisPropsToUpdate.axis.scale(mainAxisScale), axisPropsToUpdate.scale(mainAxisScale), 
                            axisPropsToUpdate.axis.ticks(selected.length), axisPropsToUpdate.axis.tickValues(selected);
                            var tickFormat_1 = visuals.SvgCartesianAxes.getTickFormatter(axisPropsToUpdate.axis);
                            if (axisPropsToUpdate.values = _.map(selected, function(d) {
                                return tickFormat_1(d);
                            }), !_.isEmpty(axisProperties.xStack)) for (var tickLabelMargins = options.axesLayout.tickLabelMargins, leafHeight = visuals.CartesianAxes.getLeafHeight(tickLabelMargins.xMax, tickLabelMargins.stackHeight, axisProperties.xStack.length), _loop_1 = function(stackIndex) {
                                var stack = axisProperties.xStack[stackIndex], singleCategoryWidth = visuals.AxisHelper.getCategoryThickness(stack.scale), stackValues = stack.values, adjustedSelected = ScrollableAxes.setLabelsAtEdges(selected, stackValues);
                                if (stack.axis.ticks(selected.length).tickValues(selected).tickFormat(function(visibleItemIndex) {
                                    var tickValue = stackValues[adjustedSelected[selected.indexOf(visibleItemIndex)]];
                                    return tickValue === visuals.CartesianAxes.hierarchyPlaceholder ? "" : _.isString(tickValue) ? tickValue : tickValue + "";
                                }), 0 === stackIndex) return "continue";
                                for (var newMaxWidths = [], newStyleInfo = [], adjustedValues = [], lastIndex = void 0, currentIndex = 0; currentIndex < adjustedSelected.length; currentIndex++) {
                                    var categoryIndex = selected[currentIndex], valueIndex = adjustedSelected[currentIndex], currentValue = stack.values[valueIndex];
                                    if (currentValue !== visuals.CartesianAxes.hierarchyPlaceholder) {
                                        if (null != lastIndex) {
                                            var categorySpanCount = categoryIndex - lastIndex;
                                            newMaxWidths[lastIndex] = visuals.CartesianAxes.getMaxCategoryWidth(categorySpanCount, singleCategoryWidth), 
                                            newStyleInfo[lastIndex] = visuals.CartesianAxes.getHierarchyLineStyleInfo({
                                                levelIndex: stackIndex,
                                                stackHeight: tickLabelMargins.stackHeight,
                                                leafHeight: leafHeight,
                                                categorySpanCount: categorySpanCount,
                                                categoryWidth: singleCategoryWidth
                                            });
                                        }
                                        adjustedValues[categoryIndex] = stackValues[valueIndex], lastIndex = categoryIndex;
                                    } else adjustedValues[categoryIndex] = visuals.CartesianAxes.hierarchyPlaceholder;
                                }
                                if (null != lastIndex) {
                                    var categorySpanCount = selected[adjustedSelected.length - 1] - lastIndex + 1;
                                    newMaxWidths[lastIndex] = visuals.CartesianAxes.getMaxCategoryWidth(categorySpanCount, singleCategoryWidth), 
                                    newStyleInfo[lastIndex] = visuals.CartesianAxes.getHierarchyLineStyleInfo({
                                        levelIndex: stackIndex,
                                        stackHeight: tickLabelMargins.stackHeight,
                                        leafHeight: leafHeight,
                                        categorySpanCount: categorySpanCount,
                                        categoryWidth: singleCategoryWidth
                                    });
                                }
                                stack.xLabelMaxWidths = newMaxWidths, stack.lineStyleInfo = newStyleInfo, stack.adjustedValues = adjustedValues;
                            }, stackIndex = 0; stackIndex < axisProperties.xStack.length; stackIndex++) _loop_1(stackIndex);
                        }
                        return {
                            startIndex: startIndex,
                            endIndex: endIndex - 1
                        };
                    }
                }
            }, ScrollableAxes.prototype.render = function(axesLayout, layers, suppressAnimations, renderDelegate, loadMoreDataHandler, preserveScrollPosition) {
                var _this = this, plotArea = axesLayout.plotArea;
                this.axisScale = null;
                var scrollbarX, scrollbarY, scrollbarLength, numVisibleCategories, categoryThickness, outerPaddingRatio, innerPaddingRatio, newAxisLength, showingScrollBar = axesLayout.isXScrollBarVisible || axesLayout.isYScrollBarVisible;
                if (loadMoreDataHandler || showingScrollBar) if (this.cartesianAxes.isYAxisCategorical) {
                    this.axisScale = axesLayout.axes.y1.scale, scrollbarX = axesLayout.viewport.width, 
                    scrollbarY = axesLayout.margin.top, categoryThickness = axesLayout.axes.y1.categoryThickness, 
                    outerPaddingRatio = axesLayout.axes.y1.outerPaddingRatio, innerPaddingRatio = axesLayout.axes.y1.innerPaddingRatio;
                    var outerPadding = categoryThickness * outerPaddingRatio;
                    newAxisLength = plotArea.height, numVisibleCategories = Math.max(1, powerbi.Double.floorWithPrecision((newAxisLength - 2 * outerPadding) / categoryThickness)), 
                    scrollbarLength = newAxisLength;
                } else {
                    this.axisScale = axesLayout.axes.x.scale, scrollbarX = axesLayout.margin.left, scrollbarY = axesLayout.viewport.height, 
                    categoryThickness = axesLayout.axes.x.categoryThickness, outerPaddingRatio = axesLayout.axes.x.outerPaddingRatio, 
                    innerPaddingRatio = axesLayout.axes.x.innerPaddingRatio;
                    var outerPadding = categoryThickness * outerPaddingRatio;
                    newAxisLength = plotArea.width, numVisibleCategories = Math.max(1, powerbi.Double.floorWithPrecision((newAxisLength - 2 * outerPadding) / categoryThickness)), 
                    scrollbarLength = newAxisLength;
                }
                if (!showingScrollBar) return loadMoreDataHandler && (loadMoreDataHandler.viewportDataRange = {
                    startIndex: 0,
                    endIndex: numVisibleCategories
                }, loadMoreDataHandler.shouldLoadMoreData() && loadMoreDataHandler.loadMoreData()), 
                this.scrollbar.remove(), void renderDelegate(layers, axesLayout, suppressAnimations, this.animateCategoryAxis, this.animateValueAxis);
                this.scrollScale = this.axisScale.copy(), this.scrollScale.rangeBands([ 0, scrollbarLength ], .1, 0), 
                this.extentLength = this.scrollScale(numVisibleCategories - 1) + this.scrollScale.rangeBand(), 
                this.scrollHandler = new AxisScrollHandler({
                    visibleScale: this.axisScale,
                    fullScale: this.scrollScale,
                    onScroll: function(startIndex) {
                        var startPosition = _this.scrollScale(startIndex), extent = {
                            start: startPosition,
                            end: null
                        };
                        _this.scrollbar.setExtent(extent), _this.scrollbar.refreshExtentAndVisual();
                    }
                }), this.axisScale.rangeBands([ 0, newAxisLength ], innerPaddingRatio, outerPaddingRatio), 
                this.scrollbar.setOrientation(axesLayout.isXScrollBarVisible), this.scrollbar.setScale(this.scrollScale), 
                this.scrollbar.scrollBarLength = scrollbarLength, this.scrollbar.setExtentLength(this.extentLength), 
                preserveScrollPosition || this.scrollbar.setExtent({
                    start: 0,
                    end: null
                }), this.renderVisualOptions = {
                    axesLayout: axesLayout,
                    layers: layers,
                    loadMoreDataHandler: loadMoreDataHandler,
                    mainAxisScale: this.axisScale,
                    renderDelegate: renderDelegate,
                    scrollScale: this.scrollScale,
                    visibleCategoryCount: numVisibleCategories,
                    animateCategoryAxis: this.animateCategoryAxis,
                    animateValueAxis: this.animateValueAxis
                };
                var onRefreshVisualCallback = function() {
                    return _this.onRefreshVisual(function(extent, suppressAnimations) {
                        return ScrollableAxes.renderVisual(_this.renderVisualOptions, extent, suppressAnimations);
                    });
                };
                if (this.scrollbar.render(scrollbarX, scrollbarY, onRefreshVisualCallback), preserveScrollPosition && loadMoreDataHandler) {
                    var startIndex = loadMoreDataHandler.viewportDataRange ? loadMoreDataHandler.viewportDataRange.startIndex : 0;
                    this.scrollTo(startIndex);
                } else ScrollableAxes.renderVisual(this.renderVisualOptions, this.scrollbar.getExtent(), suppressAnimations);
            }, ScrollableAxes.prototype.scrollDelta = function(delta) {
                this.scrollHandler.scrollDelta(delta);
            }, ScrollableAxes.prototype.scrollTo = function(index) {
                this.scrollHandler.scrollTo(index);
            }, ScrollableAxes.prototype.onRefreshVisual = function(render) {
                var extent = this.scrollbar.getExtent();
                render(extent, !0);
            }, ScrollableAxes.setLabelsAtEdges = function(indices, values) {
                if (indices.length <= 1 || values[indices[0]] !== visuals.CartesianAxes.hierarchyPlaceholder) return indices;
                var firstIndex = indices[0], returnArr = indices.slice();
                if (firstIndex < values.length && firstIndex >= 0) {
                    for (;values[firstIndex] === visuals.CartesianAxes.hierarchyPlaceholder && firstIndex >= 0; firstIndex--) ;
                    returnArr[0] = firstIndex;
                }
                return returnArr;
            }, ScrollableAxes.renderVisual = function(options, extent, suppressAnimations) {
                var dataRange = ScrollableAxes.filterDataToViewport({
                    mainAxisScale: options.mainAxisScale,
                    layers: options.layers,
                    scrollScale: options.scrollScale,
                    extent: extent,
                    visibleCategoryCount: options.visibleCategoryCount,
                    axesLayout: options.axesLayout,
                    animateCategoryAxis: options.animateCategoryAxis,
                    animateValueAxis: options.animateValueAxis
                });
                if (dataRange) {
                    if (options.loadMoreDataHandler) {
                        var loadMoreDataHandler = options.loadMoreDataHandler;
                        loadMoreDataHandler.viewportDataRange = dataRange, loadMoreDataHandler.shouldLoadMoreData() && loadMoreDataHandler.loadMoreData();
                    }
                    options.renderDelegate(options.layers, options.axesLayout, suppressAnimations, options.animateCategoryAxis, options.animateValueAxis);
                }
            }, ScrollableAxes.ScrollbarWidth = 10, ScrollableAxes;
        }();
        visuals.ScrollableAxes = ScrollableAxes;
        var AxisScrollHandler = function() {
            function AxisScrollHandler(options) {
                this.visibleScale = options.visibleScale, this.fullScale = options.fullScale, this.onScroll = options.onScroll;
                var timeout = jsCommon.Utility.valueOrDefault(options.timeout, AxisScrollHandler.defaultTimeoutMs);
                this.extendScrollTimeout = _.debounce(this.onTimeout, timeout), this.totalScrollDistance = 0;
            }
            return AxisScrollHandler.prototype.scrollDelta = function(delta) {
                if (!_.isEmpty(this.visibleScale.domain())) {
                    this.totalScrollDistance < 0 && delta > 0 || this.totalScrollDistance > 0 && delta < 0 ? this.totalScrollDistance = delta : this.totalScrollDistance += delta;
                    var stepSize = AxisScrollHandler.getStepSize(this.visibleScale);
                    if (Math.abs(this.totalScrollDistance) >= stepSize) {
                        this.extendScrollTimeout && this.extendScrollTimeout.cancel();
                        var newStartIndex = this.getNewStartIndex(this.totalScrollDistance);
                        this.scrollTo(newStartIndex), this.totalScrollDistance = 0;
                    } else this.extendScrollTimeout();
                }
            }, AxisScrollHandler.prototype.scrollTo = function(index) {
                var clampedIndex = this.clampIndex(index);
                this.onScroll(clampedIndex);
            }, AxisScrollHandler.getStepSize = function(scale) {
                var range = scale.range();
                if (range.length > 1) return range[1] - range[0];
                var rangeExtent = scale.rangeExtent();
                return rangeExtent[1] - rangeExtent[0];
            }, AxisScrollHandler.prototype.getNewStartIndex = function(scrollDistance) {
                var increasing = scrollDistance >= 0;
                scrollDistance = increasing ? scrollDistance : -scrollDistance;
                var indexDelta, visibleScale = this.visibleScale, range = visibleScale.range(), domain = visibleScale.domain(), firstVisibleIndex = domain[0], firstVisiblePosition = range[0], newVisiblePosition = firstVisiblePosition + scrollDistance, visibleRangeMaxPosition = visibleScale.rangeExtent()[1];
                if (newVisiblePosition > visibleRangeMaxPosition) {
                    var pageSize = domain.length;
                    indexDelta = pageSize;
                } else {
                    var newIndex = visuals.AxisHelper.invertOrdinalScale(visibleScale, newVisiblePosition);
                    indexDelta = newIndex - firstVisibleIndex;
                }
                return (increasing ? 1 : -1) * indexDelta + firstVisibleIndex;
            }, AxisScrollHandler.prototype.clampIndex = function(index) {
                var domain = this.fullScale.domain(), firstDataIndex = _.first(domain), lastDataIndex = _.last(domain);
                return Math.max(firstDataIndex, Math.min(lastDataIndex, index));
            }, AxisScrollHandler.prototype.onTimeout = function() {
                this.totalScrollDistance = 0;
            }, AxisScrollHandler.defaultTimeoutMs = 1e3, AxisScrollHandler;
        }();
        visuals.AxisScrollHandler = AxisScrollHandler;
        var CartesianLayerFactory = function() {
            function CartesianLayerFactory(layerViewModelAdapterFactory) {
                this.layerViewModelAdapterFactory = layerViewModelAdapterFactory, this.layerViewModelAdapterFactory || (this.layerViewModelAdapterFactory = {
                    createCartesianChartLayerViewModelAdapter: function(cartesianChartLayerType) {}
                });
            }
            return CartesianLayerFactory.prototype.createLayers = function(options) {
                var isScrollable = null != options.isScrollable && options.isScrollable, layers = [], cartesianOptions = {
                    isScrollable: isScrollable,
                    animator: options.animator,
                    interactivityService: options.interactivityService,
                    tooltipsEnabled: options.tooltipsEnabled,
                    featureSwitches: options.featureSwitches
                };
                switch (options.type) {
                  case 1:
                    layers.push(this.createLineChartLayer(2, !1, cartesianOptions));
                    break;

                  case 0:
                    layers.push(this.createLineChartLayer(1, !1, cartesianOptions));
                    break;

                  case 2:
                    layers.push(this.createLineChartLayer(16, !1, cartesianOptions));
                    break;

                  case 18:
                    layers.push(this.createRealTimeLayer(cartesianOptions));
                    break;

                  case 10:
                    layers.push(this.createScatterChartLayer(cartesianOptions));
                    break;

                  case 13:
                    layers.push(this.createWaterfallChartLayer(cartesianOptions));
                    break;

                  case 12:
                    layers.push(this.createDataDotChartLayer(cartesianOptions));
                    break;

                  case 4:
                    layers.push(this.createColumnChartLayer(20, cartesianOptions));
                    break;

                  case 3:
                    layers.push(this.createColumnChartLayer(12, cartesianOptions));
                    break;

                  case 8:
                    layers.push(this.createColumnChartLayer(52, cartesianOptions));
                    break;

                  case 6:
                    layers.push(this.createColumnChartLayer(18, cartesianOptions));
                    break;

                  case 5:
                    layers.push(this.createColumnChartLayer(10, cartesianOptions));
                    break;

                  case 7:
                    layers.push(this.createColumnChartLayer(50, cartesianOptions));
                    break;

                  case 9:
                    layers.push(this.createColumnChartLayer(68, cartesianOptions));
                    break;

                  case 11:
                    var columnType = this.getComboColumnType();
                    layers.push(this.createColumnChartLayer(columnType, cartesianOptions)), layers.push(this.createLineChartLayer(1, !0, cartesianOptions));
                    break;

                  case 14:
                    layers.push(this.createColumnChartLayer(12, cartesianOptions)), layers.push(this.createLineChartLayer(1, !0, cartesianOptions));
                    break;

                  case 15:
                    layers.push(this.createColumnChartLayer(20, cartesianOptions)), layers.push(this.createLineChartLayer(1, !0, cartesianOptions));
                    break;

                  case 16:
                    layers.push(this.createColumnChartLayer(12, cartesianOptions)), layers.push(this.createDataDotChartLayer(cartesianOptions));
                    break;

                  case 17:
                    layers.push(this.createColumnChartLayer(20, cartesianOptions)), layers.push(this.createDataDotChartLayer(cartesianOptions));
                }
                return layers;
            }, CartesianLayerFactory.prototype.createLineChartLayer = function(type, inComboChart, defaultOptions) {
                var options = {
                    animator: defaultOptions.animator,
                    interactivityService: defaultOptions.interactivityService,
                    isScrollable: defaultOptions.isScrollable,
                    tooltipsEnabled: defaultOptions.tooltipsEnabled,
                    chartType: type,
                    featureSwitches: defaultOptions.featureSwitches,
                    viewModelAdapter: this.layerViewModelAdapterFactory.createCartesianChartLayerViewModelAdapter(0)
                };
                return inComboChart && (options.chartType = 8 | options.chartType), new visuals.LineChart(options);
            }, CartesianLayerFactory.prototype.createRealTimeLayer = function(defaultOptions) {
                return defaultOptions.isScrollable = !1, new visuals.RealTimeLineChart(defaultOptions);
            }, CartesianLayerFactory.prototype.createScatterChartLayer = function(defaultOptions) {
                var options = __assign({}, defaultOptions);
                return options.isScrollable = !1, options.viewModelAdapter = this.layerViewModelAdapterFactory.createCartesianChartLayerViewModelAdapter(2), 
                new visuals.ScatterChart(options);
            }, CartesianLayerFactory.prototype.createWaterfallChartLayer = function(defaultOptions) {
                var options = __assign({}, defaultOptions);
                return options.viewModelAdapter = this.layerViewModelAdapterFactory.createCartesianChartLayerViewModelAdapter(3), 
                new visuals.WaterfallChart(options);
            }, CartesianLayerFactory.prototype.createDataDotChartLayer = function(defaultOptions) {
                return new visuals.DataDotChart(defaultOptions);
            }, CartesianLayerFactory.prototype.createColumnChartLayer = function(type, defaultOptions) {
                var options = {
                    animator: defaultOptions.animator,
                    interactivityService: defaultOptions.interactivityService,
                    isScrollable: defaultOptions.isScrollable,
                    tooltipsEnabled: defaultOptions.tooltipsEnabled,
                    featureSwitches: defaultOptions.featureSwitches,
                    chartType: type,
                    viewModelAdapter: this.layerViewModelAdapterFactory.createCartesianChartLayerViewModelAdapter(5)
                };
                return new visuals.ColumnChart(options);
            }, CartesianLayerFactory.prototype.getComboColumnType = function(objects) {
                var columnType = 12;
                if (objects) {
                    var comboChartTypes = objects.general;
                    if (comboChartTypes) {
                        switch (comboChartTypes.visualType1) {
                          case "Column":
                            columnType = 12;
                            break;

                          case "ColumnStacked":
                            columnType = 20;
                        }
                        comboChartTypes.visualType2;
                    }
                }
                return columnType;
            }, CartesianLayerFactory;
        }(), SharedColorPalette = function() {
            function SharedColorPalette(palette) {
                this.palette = palette, this.clearPreferredScale();
            }
            return SharedColorPalette.prototype.getColorScaleByKey = function(scaleKey) {
                return this.setPreferredScale(scaleKey), this.preferredScale;
            }, SharedColorPalette.prototype.getNewColorScale = function() {
                return this.preferredScale;
            }, SharedColorPalette.prototype.getColorByIndex = function(index) {
                return this.palette.getColorByIndex(index);
            }, SharedColorPalette.prototype.getSentimentColors = function() {
                return this.palette.getSentimentColors();
            }, SharedColorPalette.prototype.getBasePickerColors = function() {
                return this.palette.getBasePickerColors();
            }, SharedColorPalette.prototype.clearPreferredScale = function() {
                this.preferredScale = this.palette.getNewColorScale(), this.rotated = !1;
            }, SharedColorPalette.prototype.rotateScale = function() {
                this.preferredScale = this.preferredScale.clone(), this.preferredScale.clearAndRotateScale(), 
                this.rotated = !0;
            }, SharedColorPalette.prototype.setPreferredScale = function(scaleKey) {
                this.rotated || (this.preferredScale = this.palette.getColorScaleByKey(scaleKey));
            }, SharedColorPalette;
        }();
        visuals.SharedColorPalette = SharedColorPalette;
        var CartesianLoadMoreDataHandler = function() {
            function CartesianLoadMoreDataHandler(scale, loadMoreCallback, loadMoreThreshold) {
                void 0 === loadMoreThreshold && (loadMoreThreshold = 0), this.loadMoreThreshold = loadMoreThreshold, 
                this.loadMoreCallback = loadMoreCallback, this.setScale(scale);
            }
            return CartesianLoadMoreDataHandler.prototype.setScale = function(scale) {
                scale && (this.loadMoreThresholdIndex = scale.domain().length - 1 - this.loadMoreThreshold);
            }, CartesianLoadMoreDataHandler.prototype.isLoadingMoreData = function() {
                return this.loadingMoreData;
            }, CartesianLoadMoreDataHandler.prototype.onLoadMoreDataCompleted = function() {
                this.loadingMoreData = !1;
            }, CartesianLoadMoreDataHandler.prototype.shouldLoadMoreData = function() {
                var viewportDataRange = this.viewportDataRange;
                return !(!viewportDataRange || this.isLoadingMoreData()) && viewportDataRange.endIndex >= this.loadMoreThresholdIndex;
            }, CartesianLoadMoreDataHandler.prototype.loadMoreData = function() {
                this.isLoadingMoreData() || (this.loadingMoreData = !0, this.loadMoreCallback());
            }, CartesianLoadMoreDataHandler;
        }();
        visuals.CartesianLoadMoreDataHandler = CartesianLoadMoreDataHandler;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var CartesianChartBehavior = function() {
            function CartesianChartBehavior(behaviors) {
                this.behaviors = behaviors;
            }
            return CartesianChartBehavior.prototype.bindEvents = function(options, selectionHandler) {
                for (var behaviors = this.behaviors, i = 0, ilen = behaviors.length; i < ilen; i++) behaviors[i].bindEvents(options.layerOptions[i], selectionHandler);
                this.selectionHandler = selectionHandler, options.clearCatcher.on("mousedown", function() {
                    d3.event.ctrlKey || selectionHandler.handleClearSelection();
                });
            }, CartesianChartBehavior.prototype.renderSelection = function(hasSelection) {
                for (var _i = 0, _a = this.behaviors; _i < _a.length; _i++) {
                    var behavior = _a[_i];
                    behavior.renderSelection(hasSelection);
                }
            }, CartesianChartBehavior.prototype.hoverLassoRegion = function(e, rect) {
                for (var _i = 0, _a = this.behaviors; _i < _a.length; _i++) {
                    var behavior = _a[_i];
                    behavior.hoverLassoRegion && behavior.hoverLassoRegion(e, rect);
                }
            }, CartesianChartBehavior.prototype.lassoSelect = function(e, rect) {
                for (var _i = 0, _a = this.behaviors; _i < _a.length; _i++) {
                    var behavior = _a[_i];
                    behavior.lassoSelect && behavior.lassoSelect(e, rect);
                }
            }, CartesianChartBehavior;
        }();
        visuals.CartesianChartBehavior = CartesianChartBehavior;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var EnumExtensions = jsCommon.EnumExtensions, DataRoleHelper = powerbi.data.DataRoleHelper, createClassAndSelector = jsCommon.CssConstants.createClassAndSelector, ColumnChart = function() {
            function ColumnChart(options) {
                var chartType = options.chartType;
                this.chartType = chartType, this.categoryAxisType = null, this.animator = options.animator, 
                this.isScrollable = options.isScrollable, this.tooltipsEnabled = options.tooltipsEnabled, 
                this.interactivityService = options.interactivityService, this.axisControlImprovements = options.featureSwitches.axisControlImprovements, 
                this.customFontFamilyForDataLabel = options.featureSwitches.customFontFamilyForDataLabel, 
                this.ribbonChart = 68 === this.chartType, this.innerPaddingRatio = this.ribbonChart ? ColumnChart.ribbonChartInnerPaddingRatio : visuals.DefaultInnerPaddingRatio;
            }
            return ColumnChart.prototype.init = function(options) {
                this.svg = options.svg, this.svg.classed(ColumnChart.ColumnChartClassName, !0), 
                this.unclippedGraphicsContext = this.svg.append("g").classed("columnChartUnclippedGraphicsContext", !0), 
                this.mainGraphicsContext = this.unclippedGraphicsContext.append("svg").classed("mainGraphicsContext", !0), 
                this.style = options.style, this.currentViewport = options.viewport, this.hostService = options.host, 
                this.interactivity = options.interactivity, this.cartesianVisualHost = options.cartesianHost, 
                this.options = options, this.isComboChart = visuals.ComboChart.isComboChart(options.chartType), 
                this.element = options.element, this.tooltipService = options.services.tooltips;
            }, ColumnChart.prototype.getCategoryLayout = function(numCategoryValues, options) {
                var availableWidth;
                availableWidth = ColumnChart.isBar(this.chartType) ? this.currentViewport.height - (this.margin.top + this.margin.bottom) : this.currentViewport.width - (this.margin.left + this.margin.right), 
                availableWidth = Math.max(0, availableWidth);
                var preferredCategoryWidth = this.data ? this.data.preferredCategoryWidth : null, metaDataColumn = this.data ? this.data.categoryMetadata : void 0, categoryDataType = visuals.AxisHelper.getCategoryValueType(metaDataColumn), isScalar = !!this.data && this.data.scalarCategoryAxis, domain = visuals.AxisHelper.createDomain(this.data.series, categoryDataType, isScalar, options.forcedXDomain, options.ensureXDomain);
                return visuals.CartesianChart.getLayout(this.data, {
                    availableWidth: availableWidth,
                    categoryCount: numCategoryValues,
                    preferredCategoryWidth: preferredCategoryWidth,
                    domain: domain,
                    isScalar: isScalar,
                    isScrollable: this.isScrollable,
                    trimOrdinalDataOnOverflow: options.trimOrdinalDataOnOverflow,
                    outerPaddingRatio: options.outerPaddingRatio,
                    innerPaddingRatio: options.innerPaddingRatio
                });
            }, ColumnChart.getDefaultColumnLabelSettings = function() {
                var labelSettings = visuals.LabelUtils.getDefaultLabelSettings(!1, void 0);
                return labelSettings.position = null, labelSettings.fontProperties = visuals.LabelUtils.defaultFontProperties, 
                labelSettings.labelDensity = visuals.LabelUtils.defaultLabelDensity, labelSettings.labelOrientation = 1, 
                labelSettings;
            }, ColumnChart.converter = function(dataView, style, is100PercentStacked, isScalar, dataViewMetadata, chartType, interactivityService, tooltipsEnabled, axisControlImprovements, hostServices, ribbonChart) {
                void 0 === is100PercentStacked && (is100PercentStacked = !1), void 0 === isScalar && (isScalar = !1), 
                void 0 === dataViewMetadata && (dataViewMetadata = null), void 0 === tooltipsEnabled && (tooltipsEnabled = !0);
                var xAxisCardProperties = visuals.CartesianHelper.getCategoryAxisProperties(dataViewMetadata, !1), preferredCategoryWidth = visuals.CartesianHelper.getPreferredCategoryWidth(xAxisCardProperties);
                isScalar = visuals.CartesianHelper.isScalar(isScalar, xAxisCardProperties);
                var defaultDataPointColor, showAllDataPoints, dataViewCat = dataView.categorical, converterStrategy = new ColumnChartConverterHelper(dataView, style), categoryInfo = visuals.converterHelper.getPivotedCategories(dataViewCat, visuals.columnChartProps.general.formatString), categories = categoryInfo.categories, categoryFormatter = categoryInfo.categoryFormatter, scalarKeyInfo = visuals.CartesianHelper.getScalarKeyinfo(dataViewCat, isScalar), categoryMetadata = scalarKeyInfo.category.source, dataLabelsSettings = ColumnChart.getDefaultColumnLabelSettings(), defaultLegendLabelColor = visuals.Legend.DefaultLabelColor;
                if (dataViewMetadata && dataViewMetadata.objects) {
                    var objects = dataViewMetadata.objects;
                    defaultDataPointColor = powerbi.DataViewObjects.getFillColor(objects, visuals.columnChartProps.dataPoint.defaultColor), 
                    showAllDataPoints = powerbi.DataViewObjects.getValue(objects, visuals.columnChartProps.dataPoint.showAllDataPoints), 
                    defaultLegendLabelColor = powerbi.DataViewObjects.getFillColor(objects, visuals.columnChartProps.legend.labelColor, visuals.Legend.DefaultLabelColor);
                    var labelsObj = objects.labels;
                    visuals.LabelUtils.updateLabelSettingsFromLabelsObjectWithLabelDensity(labelsObj, dataLabelsSettings, !ColumnChart.isBar(chartType));
                }
                var ribbonOptions;
                ribbonChart && (ribbonOptions = ColumnChart.getRibbonsUtils().getRibbonOptionsFromDataviewObjects(dataViewMetadata, visuals.columnChartProps));
                var legendAndSeriesInfo = converterStrategy.getLegend(defaultLegendLabelColor, defaultDataPointColor), legend = legendAndSeriesInfo.legend.dataPoints, seriesSources = legendAndSeriesInfo.seriesSources, result = ColumnChart.createDataPoints({
                    dataView: dataView,
                    categories: categories,
                    legend: legend,
                    converterStrategy: converterStrategy,
                    defaultDataLabelsSettings: dataLabelsSettings,
                    is100PercentStacked: is100PercentStacked,
                    isScalar: isScalar,
                    style: style,
                    chartType: chartType,
                    categoryMetadata: categoryMetadata,
                    tooltipsEnabled: tooltipsEnabled,
                    ribbonChart: ribbonChart,
                    hostServices: hostServices,
                    ribbonOptions: ribbonOptions
                }), columnSeries = result.series;
                this.canSupportOverflow(chartType, columnSeries.length) ? null != dataLabelsSettings.position && _.include(this.clusteredValidLabelPositionOptions, dataLabelsSettings.position) || (dataLabelsSettings.position = visuals.labelPosition.auto) : null != dataLabelsSettings.position && _.include(this.stackedValidLabelPositionOptions, dataLabelsSettings.position) || (dataLabelsSettings.position = visuals.labelPosition.auto);
                for (var valuesMetadata = [], j = 0, jlen = legend.length; j < jlen; j++) valuesMetadata.push(seriesSources[j]);
                if (interactivityService) {
                    for (var _i = 0, columnSeries_1 = columnSeries; _i < columnSeries_1.length; _i++) {
                        var series = columnSeries_1[_i];
                        interactivityService.applySelectionStateToData(series.data);
                    }
                    interactivityService.applySelectionStateToData(legendAndSeriesInfo.legend.dataPoints);
                }
                return {
                    categories: categories,
                    categoryFormatter: categoryFormatter,
                    preferredCategoryWidth: preferredCategoryWidth,
                    series: columnSeries,
                    valuesMetadata: valuesMetadata,
                    legendData: legendAndSeriesInfo.legend,
                    hasHighlights: result.hasHighlights,
                    categoryMetadata: categoryMetadata,
                    scalarCategoryAxis: isScalar,
                    dataLabelsSettings: dataLabelsSettings,
                    hasDynamicSeries: result.hasDynamicSeries,
                    isMultiMeasure: result.isMultiMeasure,
                    ribbonChartData: ribbonChart ? {
                        ribbonChartDataPoints: result.ribbonChartDataPoints,
                        ribbonOptions: ribbonOptions
                    } : void 0
                };
            }, ColumnChart.canSupportOverflow = function(chartType, seriesCount) {
                return !ColumnChart.isStacked(chartType) && !ColumnChart.isRibbon(chartType) || 1 === seriesCount;
            }, ColumnChart.createDataPoints = function(options) {
                var dataView = options.dataView, dataViewCat = dataView.categorical, reader = powerbi.data.createDataViewCategoricalReaderAdvanced(dataView, {
                    staticSeriesRole: visuals.cartesianRoleNames.y,
                    colorOptions: {
                        valueRole: visuals.cartesianRoleNames.y,
                        visualStyle: options.style
                    }
                }), grouped = dataViewCat && dataViewCat.values ? dataViewCat.values.grouped() : void 0, categoryCount = options.categories.length, seriesCount = reader.data.hasValues("Y") ? reader.data.getSeriesCount() : void 0, columnSeries = [];
                if (seriesCount < 1 || categoryCount < 1) return {
                    series: columnSeries,
                    ribbonChartDataPoints: null,
                    hasHighlights: !1,
                    hasDynamicSeries: !1,
                    isMultiMeasure: !1
                };
                var dvCategories = dataViewCat.categories, categoryMetadata = options.categoryMetadata;
                categoryMetadata = _.isEmpty(dvCategories) ? null : _.last(dvCategories).source;
                for (var categoryType = visuals.AxisHelper.getCategoryValueType(categoryMetadata), isDateTime = visuals.AxisHelper.isDateTime(categoryType), baseValuesPos = [], baseValuesNeg = [], rawValues = [], rawHighlightValues = [], hasDynamicSeries = !(!dataViewCat.values || !dataViewCat.values.source), isMultiMeasure = !hasDynamicSeries && seriesCount > 1, highlightsOverflow = !1, hasHighlights = reader.data.hasHighlights(), converterStrategy = options.converterStrategy, seriesIndex = 0; seriesIndex < seriesCount; seriesIndex++) {
                    for (var seriesValues = [], seriesHighlightValues = [], categoryIndex = 0; categoryIndex < categoryCount; categoryIndex++) {
                        var value = converterStrategy.getValueBySeriesAndCategory(seriesIndex, categoryIndex);
                        if (seriesValues[categoryIndex] = value, hasHighlights) {
                            var highlightValue = converterStrategy.getHighlightBySeriesAndCategory(seriesIndex, categoryIndex);
                            seriesHighlightValues[categoryIndex] = highlightValue, value >= 0 && highlightValue >= 0 && powerbi.Double.greaterOrEqualWithPrecision(value, highlightValue) || value <= 0 && highlightValue <= 0 && powerbi.Double.lessOrEqualWithPrecision(value, highlightValue) || (highlightsOverflow = !0);
                        }
                    }
                    rawValues.push(seriesValues), hasHighlights && rawHighlightValues.push(seriesHighlightValues);
                }
                var chartType = options.chartType;
                highlightsOverflow && !ColumnChart.canSupportOverflow(chartType, seriesCount) && (highlightsOverflow = !1, 
                hasHighlights = !1, rawValues = rawHighlightValues);
                for (var formatStringProp = visuals.columnChartProps.general.formatString, seriesIndex = 0; seriesIndex < seriesCount; seriesIndex++) {
                    var seriesDataPoints = [], legendItem = options.legend[seriesIndex], seriesLabelSettings = void 0;
                    if (!hasDynamicSeries) {
                        var labelsSeriesGroup = !_.isEmpty(grouped) && grouped[0].values ? grouped[0].values[seriesIndex] : null, labelObjects = labelsSeriesGroup && labelsSeriesGroup.source && labelsSeriesGroup.source.objects ? labelsSeriesGroup.source.objects.labels : null;
                        labelObjects && (seriesLabelSettings = powerbi.Prototype.inherit(options.defaultDataLabelsSettings), 
                        visuals.LabelUtils.updateLabelSettingsFromLabelsObjectWithLabelDensity(labelObjects, seriesLabelSettings));
                    }
                    var valueColumnMetadata = reader.columns.getValueMetadataColumn("Y", seriesIndex), series = {
                        displayName: legendItem.label,
                        key: "series" + seriesIndex,
                        index: seriesIndex,
                        data: seriesDataPoints,
                        identity: legendItem.identity,
                        color: legendItem.color,
                        labelSettings: seriesLabelSettings,
                        type: valueColumnMetadata.type
                    };
                    columnSeries.push(series);
                    for (var gradientMeasureIndex = visuals.GradientUtils.getGradientMeasureIndex(dataViewCat), gradientValueColumn = visuals.GradientUtils.getGradientValueColumn(dataViewCat), valueMeasureIndex = DataRoleHelper.getMeasureIndexOfRole(grouped, "Y"), pctFormatString = visuals.valueFormatter.getLocalizedString("Percentage"), categoryIndex = 0; categoryIndex < categoryCount; categoryIndex++) {
                        0 === seriesIndex && (baseValuesPos.push(0), baseValuesNeg.push(0));
                        var value = visuals.AxisHelper.normalizeNonFiniteNumber(rawValues[seriesIndex][categoryIndex]);
                        if (!(null == value && seriesIndex > 0)) {
                            var originalValue = value, categoryValue = options.categories[categoryIndex];
                            if ((!isDateTime || null == categoryValue || categoryValue instanceof Date) && (isDateTime && categoryValue && (categoryValue = categoryValue.getTime()), 
                            !options.isScalar || null != categoryValue && !isNaN(categoryValue))) {
                                var multipliers = void 0, is100PercentStacked = options.is100PercentStacked;
                                is100PercentStacked && (multipliers = visuals.StackedUtil.getStackedMultiplier(rawValues, categoryIndex));
                                var unadjustedValue = value, isNegative = value < 0;
                                multipliers && (value *= isNegative ? multipliers.neg : multipliers.pos);
                                var valueAbsolute = Math.abs(value), position = void 0;
                                isNegative ? (position = baseValuesNeg[categoryIndex], isNaN(valueAbsolute) || (baseValuesNeg[categoryIndex] -= valueAbsolute)) : (isNaN(valueAbsolute) || (baseValuesPos[categoryIndex] += valueAbsolute), 
                                position = baseValuesPos[categoryIndex]);
                                var seriesGroup = grouped && grouped.length > seriesIndex && grouped[seriesIndex].values ? grouped[seriesIndex].values[valueMeasureIndex] : null, category = _.isEmpty(dataViewCat.categories) ? null : dataViewCat.categories[0], identity = visuals.SelectionIdBuilder.builder().withCategory(category, categoryIndex).withSeries(dataViewCat.values, seriesGroup).withMeasure(reader.columns.getValueMetadataColumn("Y", seriesIndex).queryName).createSelectionId(), color = reader.colors.createBySeries(seriesIndex, categoryIndex), gradientColumnForTooltip = 0 === gradientMeasureIndex ? null : gradientValueColumn, valueHighlight = void 0, unadjustedValueHighlight = void 0, absoluteValueHighlight = void 0, highlightValue = void 0, highlightPosition = void 0, highlightIdentity = void 0;
                                if (hasHighlights) {
                                    valueHighlight = reader.data.getHighlight("Y", categoryIndex, seriesIndex), unadjustedValueHighlight = valueHighlight;
                                    var highlightedTooltip = !0;
                                    null === valueHighlight && (valueHighlight = 0, highlightedTooltip = !1), is100PercentStacked && (valueHighlight *= valueHighlight > 0 ? multipliers.pos : multipliers.neg), 
                                    absoluteValueHighlight = Math.abs(valueHighlight), highlightPosition = position, 
                                    valueHighlight > 0 ? highlightPosition -= valueAbsolute - absoluteValueHighlight : 0 === valueHighlight && value > 0 && (highlightPosition -= valueAbsolute), 
                                    highlightIdentity = visuals.SelectionId.createWithHighlight(identity);
                                    var highlightedValueAndPct = void 0, highlightedValueFormat = void 0;
                                    if (highlightedTooltip && null != unadjustedValueHighlight && null != valueHighlight) {
                                        var highlightedPct = visuals.valueFormatter.format(valueHighlight, pctFormatString);
                                        highlightedValueFormat = visuals.converterHelper.formatFromMetadataColumn(unadjustedValueHighlight, valueColumnMetadata, formatStringProp, !1), 
                                        highlightedValueAndPct = highlightedValueFormat + " (" + highlightedPct + ")";
                                    }
                                    highlightValue = is100PercentStacked ? highlightedValueAndPct : highlightedValueFormat;
                                }
                                var tooltipInfo = void 0;
                                if (options.tooltipsEnabled) {
                                    if (tooltipInfo = [], category) {
                                        var categoryLevels = visuals.CategoryLevelUtils.getCategoryLevels(dataView.categorical.categories, categoryIndex, formatStringProp), concatenatedCategoryLevel = visuals.CategoryLevelUtils.concatenateCategoryLevels(categoryLevels);
                                        tooltipInfo.push({
                                            displayName: concatenatedCategoryLevel.displayName,
                                            value: concatenatedCategoryLevel.value
                                        });
                                    }
                                    if (hasDynamicSeries && (category && category.source === dataViewCat.values.source || tooltipInfo.push({
                                        displayName: dataViewCat.values.source.displayName,
                                        value: visuals.converterHelper.formatFromMetadataColumn(grouped[seriesIndex].name, dataViewCat.values.source, formatStringProp)
                                    })), null != originalValue) {
                                        var valueString = void 0, formattedOriginalValue = visuals.converterHelper.formatFromMetadataColumn(originalValue, valueColumnMetadata, formatStringProp, !1);
                                        if (is100PercentStacked) {
                                            var originalPct = visuals.valueFormatter.format(valueAbsolute, pctFormatString);
                                            valueString = formattedOriginalValue + " (" + originalPct + ")";
                                        } else valueString = formattedOriginalValue;
                                        tooltipInfo.push({
                                            displayName: valueColumnMetadata.displayName,
                                            value: valueString
                                        });
                                    }
                                    null != highlightValue && tooltipInfo.push({
                                        displayName: visuals.ToolTipComponent.localizationOptions.highlightedValueDisplayName,
                                        value: highlightValue
                                    }), gradientColumnForTooltip && null != gradientColumnForTooltip.values[categoryIndex] && tooltipInfo.push({
                                        displayName: gradientColumnForTooltip.source.displayName,
                                        value: visuals.converterHelper.formatFromMetadataColumn(gradientColumnForTooltip.values[categoryIndex], gradientColumnForTooltip.source, formatStringProp, !1)
                                    }), visuals.TooltipBuilder.addTooltipMeasures(reader, tooltipInfo, categoryIndex, hasDynamicSeries ? seriesIndex : void 0, formatStringProp);
                                }
                                var series_1 = columnSeries[seriesIndex], dataPointLabelSettings = series_1.labelSettings ? series_1.labelSettings : options.defaultDataLabelsSettings, labelColor = dataPointLabelSettings.fontProperties.color, lastValue = void 0;
                                ColumnChart.isStacked(chartType) && (lastValue = this.getStackedLabelColor(isNegative, seriesIndex, seriesCount, categoryIndex, rawValues), 
                                labelColor = lastValue || seriesIndex === seriesCount - 1 && !isNegative ? labelColor : visuals.LabelUtils.defaultInsideLabelColor);
                                var dataPoint = {
                                    categoryValue: categoryValue,
                                    value: value,
                                    position: position,
                                    valueAbsolute: valueAbsolute,
                                    valueOriginal: unadjustedValue,
                                    seriesIndex: seriesIndex,
                                    labelSettings: dataPointLabelSettings,
                                    categoryIndex: categoryIndex,
                                    color: color,
                                    selected: !1,
                                    originalValue: value,
                                    originalPosition: position,
                                    originalValueAbsolute: valueAbsolute,
                                    identity: identity,
                                    key: identity.getKey(),
                                    tooltipInfo: tooltipInfo,
                                    labelFill: labelColor,
                                    labelFormatString: valueColumnMetadata.format,
                                    lastSeries: lastValue,
                                    chartType: chartType
                                };
                                if (seriesDataPoints.push(dataPoint), hasHighlights) {
                                    var highlightDataPoint = {
                                        categoryValue: categoryValue,
                                        value: valueHighlight,
                                        position: highlightPosition,
                                        valueAbsolute: absoluteValueHighlight,
                                        valueOriginal: unadjustedValueHighlight,
                                        seriesIndex: seriesIndex,
                                        labelSettings: dataPointLabelSettings,
                                        categoryIndex: categoryIndex,
                                        color: color,
                                        selected: !1,
                                        highlight: !0,
                                        originalValue: value,
                                        originalPosition: position,
                                        originalValueAbsolute: valueAbsolute,
                                        drawThinner: highlightsOverflow,
                                        identity: highlightIdentity,
                                        key: highlightIdentity.getKey(),
                                        tooltipInfo: tooltipInfo,
                                        labelFormatString: valueColumnMetadata.format,
                                        labelFill: labelColor,
                                        lastSeries: lastValue,
                                        chartType: chartType
                                    };
                                    seriesDataPoints.push(highlightDataPoint);
                                }
                            }
                        }
                    }
                }
                var ribbonChartDataPoints;
                return seriesCount > 1 && categoryCount > 1 && options.ribbonChart && (ribbonChartDataPoints = ColumnChart.getRibbonsUtils().createRibbonChartDataPoints({
                    columnSeries: columnSeries,
                    hasHighlights: hasHighlights,
                    hasDynamicSeries: hasDynamicSeries,
                    ribbonChartDataPoints: ribbonChartDataPoints,
                    categoryCount: categoryCount,
                    formatStringProp: formatStringProp,
                    reader: reader,
                    hostServices: options.hostServices,
                    ribbonOptions: options.ribbonOptions
                })), {
                    series: columnSeries,
                    ribbonChartDataPoints: ribbonChartDataPoints,
                    hasHighlights: hasHighlights,
                    hasDynamicSeries: hasDynamicSeries,
                    isMultiMeasure: isMultiMeasure
                };
            }, ColumnChart.getStackedLabelColor = function(isNegative, seriesIndex, seriesCount, categoryIndex, rawValues) {
                for (var lastValue = !(isNegative && seriesIndex === seriesCount - 1 && 1 !== seriesCount), i = seriesIndex + 1; i < seriesCount; i++) {
                    var nextValues = visuals.AxisHelper.normalizeNonFiniteNumber(rawValues[i][categoryIndex]);
                    if (null !== nextValues && ((!isNegative || isNegative && 0 === seriesIndex) && nextValues > 0 || isNegative && 0 !== seriesIndex)) {
                        lastValue = !1;
                        break;
                    }
                }
                return lastValue;
            }, ColumnChart.sliceSeries = function(series, endIndex, startIndex) {
                void 0 === startIndex && (startIndex = 0);
                var newSeries = [];
                if (series && series.length > 0) for (var i = 0, len = series.length; i < len; i++) {
                    var iNewSeries = newSeries[i] = powerbi.Prototype.inherit(series[i]);
                    iNewSeries.data = series[i].data.filter(function(d) {
                        return d.categoryIndex >= startIndex && d.categoryIndex < endIndex;
                    });
                }
                return newSeries;
            }, ColumnChart.getInteractiveColumnChartDomElement = function(element) {
                return element.children("svg").get(0);
            }, ColumnChart.prototype.setData = function(dataViews) {
                var is100PctStacked = ColumnChart.isStacked100(this.chartType);
                if (this.data = {
                    categories: [],
                    categoryFormatter: null,
                    series: [],
                    valuesMetadata: [],
                    legendData: null,
                    hasHighlights: !1,
                    categoryMetadata: null,
                    scalarCategoryAxis: !1,
                    dataLabelsSettings: ColumnChart.getDefaultColumnLabelSettings(),
                    hasDynamicSeries: !1,
                    isMultiMeasure: !1
                }, dataViews.length > 0) {
                    var dataView = this.dataView = dataViews[0];
                    if (dataView && dataView.categorical) {
                        var dvCategories = dataView.categorical.categories, categoryMetadata = dvCategories && dvCategories.length > 0 ? dvCategories[0].source : null, categoryType = visuals.AxisHelper.getCategoryValueType(categoryMetadata), hasHierarchy = visuals.CartesianHelper.hasCategoryHierarchy(dataView), isScalar = visuals.ScalarUtils.shouldDrawScalar(dataView.metadata ? dataView.metadata.objects : null, visuals.columnChartProps.categoryAxis.axisType, categoryType, void 0, hasHierarchy);
                        this.data = ColumnChart.converter(dataView, this.style, is100PctStacked, isScalar, dataView.metadata, this.chartType, this.interactivityService, this.tooltipsEnabled, this.axisControlImprovements, this.hostService, this.ribbonChart);
                    }
                }
                this.setChartStrategy();
            }, ColumnChart.prototype.setChartStrategy = function() {
                switch (this.chartType) {
                  case 10:
                    this.columnChart = new visuals.ClusteredBarChartStrategy();
                    break;

                  case 12:
                    this.columnChart = new visuals.ClusteredColumnChartStrategy();
                    break;

                  case 18:
                  case 50:
                    this.columnChart = new visuals.StackedBarChartStrategy();
                    break;

                  case 20:
                  case 52:
                  case 68:
                    this.columnChart = new visuals.StackedColumnChartStrategy();
                    break;

                  default:
                    this.columnChart = new visuals.StackedColumnChartStrategy();
                }
                if (ColumnChart.isStacked(this.chartType) && 1 === this.data.series.length) switch (this.chartType) {
                  case 18:
                    this.columnChart = new visuals.ClusteredBarChartStrategy();
                    break;

                  case 20:
                    this.columnChart = new visuals.ClusteredColumnChartStrategy();
                }
            }, ColumnChart.prototype.calculateLegend = function() {
                if (this.interactivity && this.interactivity.isInteractiveLegend) return this.createInteractiveLegendDataPoints(0);
                var legendData = this.data ? this.data.legendData : null, legendDataPoints = legendData ? legendData.dataPoints : [];
                return _.isEmpty(legendDataPoints) ? null : legendData;
            }, ColumnChart.prototype.hasLegend = function() {
                return this.data && (this.data.hasDynamicSeries || this.data.series && this.data.series.length > 1);
            }, ColumnChart.prototype.enumerateObjectInstances = function(enumeration, options) {
                switch (options.objectName) {
                  case "dataPoint":
                    this.dataView && !visuals.GradientUtils.hasGradientRole(this.dataView.categorical) && this.enumerateDataPoints(enumeration);
                    break;

                  case "labels":
                    this.enumerateDataLabels(enumeration);
                    break;

                  case "ribbonChart":
                    ColumnChart.getRibbonsUtils().enumerateRibbonChart(enumeration, this.data.ribbonChartData, this.ribbonChart);
                }
            }, ColumnChart.prototype.enumerateDataLabels = function(enumeration) {
                var labelPositions, data = this.data, labelSettings = data.dataLabelsSettings, seriesCount = data.series.length, showLabelPerSeries = !data.hasDynamicSeries && (seriesCount > 1 || !data.categoryMetadata);
                if (labelPositions = ColumnChart.canSupportOverflow(this.chartType, data.series.length) ? ColumnChart.clusteredValidLabelPositionOptions : ColumnChart.stackedValidLabelPositionOptions, 
                visuals.LabelUtils.enumerateDataLabels(this.getLabelSettingsOptions(enumeration, labelSettings, null, showLabelPerSeries, labelPositions)), 
                seriesCount > 0 && showLabelPerSeries && labelSettings.showLabelPerSeries) for (var i = 0; i < seriesCount; i++) {
                    var series = data.series[i], labelSettings_1 = series.labelSettings ? series.labelSettings : data.dataLabelsSettings;
                    enumeration.pushContainer({
                        displayName: series.displayName
                    }), visuals.LabelUtils.enumerateDataLabels(this.getLabelSettingsOptions(enumeration, labelSettings_1, series)), 
                    enumeration.popContainer();
                }
            }, ColumnChart.prototype.getLabelSettingsOptions = function(enumeration, labelSettings, series, showAll, labelPositions) {
                return {
                    enumeration: enumeration,
                    dataLabelsSettings: labelSettings,
                    show: !0,
                    positionObject: labelPositions,
                    labelOrientation: !ColumnChart.isBar(this.chartType) && !series,
                    position: !series,
                    displayUnits: !ColumnChart.isStacked100(this.chartType),
                    precision: !0,
                    selector: series && series.identity ? series.identity.getSelector() : null,
                    showAll: showAll,
                    fontSize: !0,
                    fontFamily: this.customFontFamilyForDataLabel,
                    labelDensity: this.data && this.data.scalarCategoryAxis
                };
            }, ColumnChart.prototype.enumerateDataPoints = function(enumeration) {
                var data = this.data;
                if (data) {
                    var seriesCount = data.series.length;
                    0 !== seriesCount && (data.hasDynamicSeries || seriesCount > 1 || !data.categoryMetadata ? powerbi.requireSync("PowerBIVisuals/Visuals/common/colorEnumerationHelper").enumerateSeriesDataColors({
                        enumeration: enumeration,
                        dataPoints: data.series
                    }) : powerbi.requireSync("PowerBIVisuals/Visuals/common/colorEnumerationHelper").enumerateCategoryDataColors({
                        enumeration: enumeration,
                        dataView: this.dataView,
                        style: this.style,
                        dataPoints: _.map(data.series[0].data, function(category) {
                            return {
                                color: category.color,
                                displayName: data.categoryFormatter.format(data.categories[category.categoryIndex]),
                                identity: category.identity
                            };
                        })
                    }));
                }
            }, ColumnChart.prototype.getValueDomain = function(options, includeZero) {
                var valueDomain, is100Pct = ColumnChart.isStacked100(this.chartType);
                if (this.isStacked()) {
                    var valueDomainRange = visuals.StackedUtil.calcValueDomain(this.data.series, is100Pct);
                    valueDomain = [ valueDomainRange.min, valueDomainRange.max ];
                } else valueDomain = visuals.AxisHelper.createValueDomain(this.data.series, !0) || visuals.emptyDomain;
                var combinedDomain = visuals.AxisHelper.combineDomain(options.forcedYDomain, valueDomain, options.ensureYDomain);
                return combinedDomain;
            }, ColumnChart.prototype.calculateAxesProperties = function(options) {
                var data = this.data;
                this.currentViewport = options.viewport;
                var margin = this.margin = options.margin, origCatgSize = data && data.categories ? data.categories.length : 0, chartLayout = data ? this.getCategoryLayout(origCatgSize, options) : {
                    categoryCount: 0,
                    categoryThickness: visuals.CartesianHelper.MinOrdinalRectThickness,
                    outerPaddingRatio: options.outerPaddingRatio,
                    innerPaddingRatio: options.innerPaddingRatio,
                    isScalar: !1
                };
                if (this.categoryAxisType = chartLayout.isScalar ? visuals.axisType.scalar : null, 
                data && !chartLayout.isScalar && !this.isScrollable && options.trimOrdinalDataOnOverflow) {
                    var catgSize = Math.min(origCatgSize, chartLayout.categoryCount);
                    catgSize !== origCatgSize && (data = powerbi.Prototype.inherit(data), data.series = ColumnChart.sliceSeries(data.series, catgSize), 
                    data.categories = data.categories.slice(0, catgSize));
                }
                this.columnChart.setData(data);
                var preferredPlotArea = this.getPreferredPlotArea(chartLayout.isScalar, chartLayout.categoryCount, chartLayout.categoryThickness, chartLayout.outerPaddingRatio), is100Pct = ColumnChart.isStacked100(this.chartType), chartContext = {
                    height: preferredPlotArea.height,
                    width: preferredPlotArea.width,
                    duration: 0,
                    hostService: this.hostService,
                    unclippedGraphicsContext: this.unclippedGraphicsContext,
                    mainGraphicsContext: this.mainGraphicsContext,
                    margin: this.margin,
                    layout: chartLayout,
                    animator: this.animator,
                    interactivityService: this.interactivityService,
                    viewportHeight: this.currentViewport.height - (margin.top + margin.bottom),
                    viewportWidth: this.currentViewport.width - (margin.left + margin.right),
                    is100Pct: is100Pct,
                    isComboChart: this.isComboChart
                };
                this.ApplyInteractivity(chartContext), this.columnChart.setupVisualProps(chartContext);
                var ensureXDomain, ensureYDomain, isBarChart = ColumnChart.isBar(this.chartType);
                if (isBarChart) {
                    var temp = options.forcedXDomain;
                    options.forcedXDomain = options.forcedYDomain, options.forcedYDomain = temp;
                    var temp2 = options.preventNiceX;
                    options.preventNiceX = options.preventNiceY, options.preventNiceY = temp2, ensureXDomain = options.ensureYDomain;
                } else ensureYDomain = options.ensureYDomain;
                return this.xAxisProperties = this.columnChart.setXScale({
                    is100Pct: is100Pct,
                    forcedTickCount: options.forcedTickCount,
                    forcedXDomain: options.forcedXDomain,
                    axisScaleType: isBarChart ? options.valueAxisScaleType : options.categoryAxisScaleType,
                    axisDisplayUnits: isBarChart ? options.valueAxisDisplayUnits : options.categoryAxisDisplayUnits,
                    axisPrecision: isBarChart ? options.valueAxisPrecision : options.categoryAxisPrecision,
                    ensureXDomain: ensureXDomain,
                    outerPaddingRatio: isBarChart ? 0 : chartLayout.outerPaddingRatio,
                    margin: margin,
                    preventNice: options.preventNiceX,
                    innerPaddingRatio: this.innerPaddingRatio
                }), this.yAxisProperties = this.columnChart.setYScale({
                    is100Pct: is100Pct,
                    forcedTickCount: options.forcedTickCount,
                    forcedYDomain: options.forcedYDomain,
                    axisScaleType: isBarChart ? options.categoryAxisScaleType : options.valueAxisScaleType,
                    axisDisplayUnits: isBarChart ? options.categoryAxisDisplayUnits : options.valueAxisDisplayUnits,
                    axisPrecision: isBarChart ? options.categoryAxisPrecision : options.valueAxisPrecision,
                    ensureYDomain: ensureYDomain,
                    outerPaddingRatio: isBarChart ? chartLayout.outerPaddingRatio : 0,
                    margin: margin,
                    preventNice: options.preventNiceY,
                    innerPaddingRatio: this.innerPaddingRatio
                }), [ this.xAxisProperties, this.yAxisProperties ];
            }, ColumnChart.prototype.getPreferredPlotArea = function(isScalar, categoryCount, categoryThickness, outerPaddingRatio) {
                var plotArea = {
                    height: this.currentViewport.height - this.margin.top - this.margin.bottom,
                    width: this.currentViewport.width - this.margin.left - this.margin.right
                };
                if (this.isScrollable && !isScalar) {
                    var preferredCategorySpan = visuals.CartesianChart.getPreferredCategorySpan(categoryCount, categoryThickness, outerPaddingRatio);
                    ColumnChart.isBar(this.chartType) ? plotArea.height = Math.max(preferredCategorySpan, plotArea.height) : plotArea.width = Math.max(preferredCategorySpan, plotArea.width);
                }
                return plotArea;
            }, ColumnChart.prototype.ApplyInteractivity = function(chartContext) {
                var _this = this, interactivity = this.interactivity;
                if (interactivity && (interactivity.dragDataPoint && (chartContext.onDragStart = function(datum) {
                    datum.identity && _this.hostService.onDragStart({
                        event: d3.event,
                        data: {
                            data: datum.identity.getSelector()
                        }
                    });
                }), interactivity.isInteractiveLegend)) {
                    var dragMove = function() {
                        var mousePoint = d3.mouse(_this.mainGraphicsContext[0][0]), x = mousePoint[0], y = mousePoint[1], index = _this.columnChart.getClosestColumnIndex(x, y, _this.innerPaddingRatio);
                        _this.selectColumn(index);
                    }, ColumnChartSvg = ColumnChart.getInteractiveColumnChartDomElement(this.element);
                    this.svg.on("click", dragMove), d3.select(ColumnChartSvg).on("click", dragMove).style("touch-action", "none");
                    var drag = d3.behavior.drag().origin(Object).on("drag", dragMove);
                    this.svg.call(drag), d3.select(ColumnChartSvg).call(drag);
                }
            }, ColumnChart.prototype.selectLastSelectedColumnOrDefault = function(forceDimAll) {
                void 0 === forceDimAll && (forceDimAll = !1);
                var shouldSelectDefault = void 0 === this.lastInteractiveSelectedColumnIndex, columnIndexToSelect = shouldSelectDefault ? visuals.CartesianHelper.findMaxCategoryIndex(this.data.series) : this.lastInteractiveSelectedColumnIndex;
                this.selectColumn(columnIndexToSelect, forceDimAll);
            }, ColumnChart.prototype.selectColumn = function(columnIndexToSelect, forceDimAll) {
                if (void 0 === forceDimAll && (forceDimAll = !1), forceDimAll || this.lastInteractiveSelectedColumnIndex !== columnIndexToSelect) {
                    var legendData = this.createInteractiveLegendDataPoints(columnIndexToSelect);
                    this.columnChart.selectColumn(columnIndexToSelect, this.lastInteractiveSelectedColumnIndex, forceDimAll, this.innerPaddingRatio), 
                    this.cartesianVisualHost.updateLegend(legendData), this.lastInteractiveSelectedColumnIndex = columnIndexToSelect;
                }
            }, ColumnChart.prototype.createInteractiveLegendDataPoints = function(columnIndex) {
                var data = this.data, legendData = visuals.Legend.getDefaultLegendData();
                if (!data || _.isEmpty(data.series)) return legendData;
                for (var formatStringProp = visuals.columnChartProps.general.formatString, legendDataPoints = [], category = data.categories && data.categories[columnIndex], allSeries = data.series, dataPoints = data.legendData && data.legendData.dataPoints, converterStrategy = new ColumnChartConverterHelper(this.dataView, this.style), i = 0, len = allSeries.length; i < len; i++) {
                    var measure = converterStrategy.getValueBySeriesAndCategory(i, columnIndex), valueMetadata = data.valuesMetadata[i], formattedLabel = visuals.converterHelper.getFormattedLegendLabel(valueMetadata, this.dataView.categorical.values, formatStringProp), dataPointColor = void 0;
                    if (1 === allSeries.length) {
                        var series = allSeries[0];
                        dataPointColor = series.data.length > columnIndex && series.data[columnIndex].color;
                    } else dataPointColor = dataPoints.length > i && dataPoints[i].color;
                    legendDataPoints.push({
                        color: dataPointColor,
                        icon: visuals.LegendIcon.Box,
                        label: formattedLabel,
                        category: data.categoryFormatter ? data.categoryFormatter.format(category) : category,
                        measure: visuals.valueFormatter.format(measure, visuals.valueFormatter.getFormatString(valueMetadata, formatStringProp)),
                        identity: visuals.SelectionId.createNull(),
                        selected: !1
                    });
                }
                return legendData.dataPoints = legendDataPoints, legendData;
            }, ColumnChart.prototype.overrideXScale = function(xProperties) {
                this.xAxisProperties = xProperties;
            }, ColumnChart.prototype.render = function(suppressAnimations) {
                var columnChartDrawInfo = this.columnChart.drawColumns(!suppressAnimations), data = this.data, margin = this.margin, viewport = this.currentViewport, height = viewport.height - (margin.top + margin.bottom), width = viewport.width - (margin.left + margin.right);
                this.mainGraphicsContext.attr("height", height).attr("width", width), this.tooltipsEnabled && this.tooltipService.addTooltip(columnChartDrawInfo.eventGroup, function(args) {
                    return args.data && args.data.tooltipInfo;
                }, function(args) {
                    return args.data && args.data.identity;
                }), this.tooltipsEnabled && columnChartDrawInfo.ribbonChartEventGroup && this.tooltipService.addTooltip(columnChartDrawInfo.ribbonChartEventGroup, function(args) {
                    return args.data && args.data.tooltipInfo;
                }, function(args) {
                    return visuals.SelectionId.createNull();
                });
                var behaviorOptions, allDataPoints = [];
                if (this.interactivityService) {
                    for (var i = 0, ilen = data.series.length; i < ilen; i++) allDataPoints = allDataPoints.concat(data.series[i].data);
                    behaviorOptions = {
                        datapoints: allDataPoints,
                        columnChartDrawInfo: columnChartDrawInfo,
                        hasHighlights: data.hasHighlights,
                        mainGraphicsContext: this.mainGraphicsContext,
                        showLabel: data.dataLabelsSettings.show,
                        bandsTransparency: this.data.ribbonChartData ? this.data.ribbonChartData.ribbonOptions.bandsTransparency : 30
                    };
                }
                return this.interactivity && this.interactivity.isInteractiveLegend && this.selectLastSelectedColumnOrDefault(!0), 
                visuals.SVGUtil.flushAllD3TransitionsIfNeeded(this.options), {
                    dataPoints: allDataPoints,
                    behaviorOptions: behaviorOptions,
                    labelDataPoints: [],
                    labelDataPointGroups: columnChartDrawInfo.labelDataPointGroups,
                    labelsAreNumeric: !0,
                    labelOrientation: data.dataLabelsSettings.labelOrientation,
                    animateLabels: columnChartDrawInfo.animateLabels
                };
            }, ColumnChart.prototype.onClearSelection = function() {
                this.interactivityService && this.interactivityService.clearSelection();
            }, ColumnChart.prototype.getVisualCategoryAxisIsScalar = function() {
                return !!this.data && this.data.scalarCategoryAxis;
            }, ColumnChart.prototype.getSupportedCategoryAxisType = function() {
                var metaDataColumn = this.data ? this.data.categoryMetadata : void 0, valueType = visuals.AxisHelper.getCategoryValueType(metaDataColumn), isOrdinal = visuals.AxisHelper.isOrdinal(valueType);
                return isOrdinal ? visuals.axisType.categorical : visuals.axisType.both;
            }, ColumnChart.prototype.setFilteredData = function(startIndex, endIndex) {
                var data = powerbi.Prototype.inherit(this.data);
                return data.series = ColumnChart.sliceSeries(data.series, endIndex, startIndex), 
                data.categories = data.categories.slice(startIndex, endIndex), this.columnChart.setData(data), 
                data;
            }, ColumnChart.prototype.supportsTrendLine = function() {
                var dataView = this.dataView, reader = powerbi.data.createDataViewCategoricalReader(dataView), isScalar = !!this.data && this.data.scalarCategoryAxis;
                return 12 === this.chartType && isScalar && reader.data.hasValues("Y");
            }, ColumnChart.prototype.supportsValueAxis = function() {
                return 68 !== this.chartType;
            }, ColumnChart.prototype.isStacked = function() {
                return ColumnChart.isStacked(this.chartType);
            }, ColumnChart.isBar = function(chartType) {
                return EnumExtensions.hasFlag(chartType, 2);
            }, ColumnChart.isColumn = function(chartType) {
                return EnumExtensions.hasFlag(chartType, 4);
            }, ColumnChart.isClustered = function(chartType) {
                return EnumExtensions.hasFlag(chartType, 8);
            }, ColumnChart.isStacked = function(chartType) {
                return EnumExtensions.hasFlag(chartType, 16);
            }, ColumnChart.isStacked100 = function(chartType) {
                return EnumExtensions.hasFlag(chartType, 48);
            }, ColumnChart.isRibbon = function(chartType) {
                return EnumExtensions.hasFlag(chartType, 64);
            }, ColumnChart.prototype.getCartesianVisualCapabilities = function() {
                return {
                    supportsHierarchicalCategoryAxis: ColumnChart.isColumn(this.chartType),
                    supportsValueAxis: this.supportsValueAxis()
                };
            }, ColumnChart.prototype.getStaticSeriesRole = function() {
                return "Y";
            }, ColumnChart.getRibbonsUtils = function() {
                return powerbi.requireSync("PowerBIVisuals/visuals/common/ribbonChartUtils");
            }, ColumnChart.prototype.getInnerPaddingRatio = function() {
                return this.innerPaddingRatio;
            }, ColumnChart.ColumnChartClassName = "columnChart", ColumnChart.AutoLabelPosition = "Auto", 
            ColumnChart.clusteredValidLabelPositionOptions = [ ColumnChart.AutoLabelPosition, visuals.labelPosition.outsideEnd, visuals.labelPosition.insideEnd, visuals.labelPosition.insideCenter, visuals.labelPosition.insideBase ], 
            ColumnChart.stackedValidLabelPositionOptions = [ ColumnChart.AutoLabelPosition, visuals.labelPosition.insideCenter, visuals.labelPosition.insideEnd, visuals.labelPosition.insideBase ], 
            ColumnChart.RibbonChartItemClasses = createClassAndSelector("ribbonChartArea"), 
            ColumnChart.RibbonChartLayerClasses = createClassAndSelector("ribbonChartLayer"), 
            ColumnChart.ribbonChartInnerPaddingRatio = .6, ColumnChart;
        }();
        visuals.ColumnChart = ColumnChart;
        var ColumnChartConverterHelper = function() {
            function ColumnChartConverterHelper(dataView, visualStyle) {
                this.dataView = dataView && dataView.categorical, this.reader = powerbi.data.createDataViewCategoricalReaderAdvanced(dataView, {
                    staticSeriesRole: "Y",
                    colorOptions: {
                        valueRole: "Y",
                        visualStyle: visualStyle
                    }
                });
            }
            return ColumnChartConverterHelper.prototype.getLegend = function(defaultLegendLabelColor, defaultColor) {
                var legendTitle, legend = [], seriesSources = [], seriesObjects = [], grouped = !1, reader = this.reader;
                if (this.dataView && this.dataView.values) {
                    for (var allValues = this.dataView.values, valueGroups = allValues.grouped(), formatStringProp = visuals.columnChartProps.general.formatString, valueGroupsIndex = 0, valueGroupsLen = valueGroups.length; valueGroupsIndex < valueGroupsLen; valueGroupsIndex++) for (var valueGroup = valueGroups[valueGroupsIndex], values = valueGroup.values, valueIndex = 0, valuesLen = values.length; valueIndex < valuesLen; valueIndex++) {
                        var series = values[valueIndex], source = series.source;
                        if (!DataRoleHelper.hasRole(source, "Gradient") && !DataRoleHelper.hasRole(source, "Tooltips") || DataRoleHelper.hasRole(source, "Y")) {
                            seriesSources.push(source), seriesObjects.push(series.objects);
                            var selectionIdBuilder = new visuals.SelectionIdBuilder();
                            selectionIdBuilder = selectionIdBuilder.withMeasure(source.queryName), reader.columns.hasDynamicSeries() && (selectionIdBuilder = selectionIdBuilder.withSeries(reader.columns.getSeriesValueColumns(), reader.columns.getSeriesValueColumnGroup(valueGroupsIndex)));
                            var selectionId = selectionIdBuilder.createSelectionId(), label = visuals.converterHelper.getFormattedLegendLabel(source, allValues, formatStringProp), color = reader.colors.createBySeries(reader.columns.hasDynamicSeries() ? valueGroupsIndex : valueIndex);
                            legend.push({
                                icon: visuals.LegendIcon.Box,
                                color: color,
                                label: label,
                                identity: selectionId,
                                selected: !1
                            }), series.identity && void 0 !== source.groupName && (grouped = !0);
                        }
                    }
                    var dvValues = this.dataView.values;
                    legendTitle = dvValues && dvValues.source ? dvValues.source.displayName : "";
                }
                var legendData = visuals.Legend.getDefaultLegendData();
                return legendData.title = legendTitle, legendData.dataPoints = legend, legendData.grouped = grouped, 
                {
                    legend: legendData,
                    seriesSources: seriesSources,
                    seriesObjects: seriesObjects
                };
            }, ColumnChartConverterHelper.prototype.getValueBySeriesAndCategory = function(series, category) {
                return this.reader.data.getValue("Y", category, series);
            }, ColumnChartConverterHelper.prototype.getHighlightBySeriesAndCategory = function(series, category) {
                return this.reader.data.getHighlight("Y", category, series);
            }, ColumnChartConverterHelper;
        }();
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var WebColumnChartAnimator = function(_super) {
            function WebColumnChartAnimator(options) {
                return _super.call(this, options) || this;
            }
            return __extends(WebColumnChartAnimator, _super), WebColumnChartAnimator.prototype.animate = function(options) {
                var result = {
                    failed: !0,
                    shapes: null
                }, viewModel = options.viewModel, previousViewModel = this.previousViewModel, dataPointCount = viewModel.categories.length * viewModel.series.length;
                return dataPointCount > visuals.AnimatorCommon.MaxDataPointsToAnimate || previousViewModel && previousViewModel.categories.length !== viewModel.categories.length ? result : (previousViewModel && (viewModel.hasHighlights && !previousViewModel.hasHighlights ? result = this.animateNormalToHighlighted(options) : viewModel.hasHighlights && previousViewModel.hasHighlights ? result = this.animateHighlightedToHighlighted(options) : !viewModel.hasHighlights && previousViewModel.hasHighlights && (result = this.animateHighlightedToNormal(options))), 
                this.previousViewModel = viewModel, result);
            }, WebColumnChartAnimator.prototype.animateNormalToHighlighted = function(options) {
                var data = options.viewModel, itemCS = options.itemCS, shapeSelection = options.series.selectAll(itemCS.selector), shapes = shapeSelection.data(function(d) {
                    return d.data;
                }, function(d) {
                    return d.key;
                }), hasHighlights = data.hasHighlights;
                return shapes.enter().append("rect").attr("class", function(d) {
                    return itemCS.class.concat(d.highlight ? " highlight" : "");
                }).attr(options.layout.shapeLayoutWithoutHighlights), shapes.style("fill", function(d) {
                    return d.color;
                }).style("fill-opacity", function(d) {
                    return visuals.ColumnUtil.getFillOpacity(d.selected, d.highlight, !1, hasHighlights);
                }).transition().duration(this.animationDuration).attr(options.layout.shapeLayout), 
                shapes.exit().remove(), {
                    failed: !1,
                    shapes: shapes
                };
            }, WebColumnChartAnimator.prototype.animateHighlightedToHighlighted = function(options) {
                var shapes = this.animateDefaultShapes(options.viewModel, options.series, options.layout, options.itemCS);
                return {
                    failed: !1,
                    shapes: shapes
                };
            }, WebColumnChartAnimator.prototype.animateHighlightedToNormal = function(options) {
                var itemCS = options.itemCS, shapeSelection = options.series.selectAll(itemCS.selector), shapes = shapeSelection.data(function(d) {
                    return d.data;
                }, function(d) {
                    return d.key;
                }), hasSelection = options.interactivityService && options.interactivityService.hasSelection();
                return shapes.enter().append("rect").attr("class", function(d) {
                    return itemCS.class.concat(d.highlight ? " highlight" : "");
                }), shapes.style("fill", function(d) {
                    return d.color;
                }).style("fill-opacity", function(d) {
                    return visuals.ColumnUtil.getFillOpacity(d.selected, d.highlight, d.selected, !d.selected);
                }).transition().duration(this.animationDuration).attr(options.layout.shapeLayout).transition().duration(0).delay(this.animationDuration).style("fill-opacity", function(d) {
                    return visuals.ColumnUtil.getFillOpacity(d.selected, d.highlight, hasSelection, !1);
                }), shapes.exit().transition().duration(this.animationDuration).attr(hasSelection ? options.layout.zeroShapeLayout : options.layout.shapeLayoutWithoutHighlights).remove(), 
                {
                    failed: !1,
                    shapes: shapes
                };
            }, WebColumnChartAnimator.prototype.animateDefaultShapes = function(data, series, layout, itemCS) {
                var shapeSelection = series.selectAll(itemCS.selector), shapes = shapeSelection.data(function(d) {
                    return d.data;
                }, function(d) {
                    return d.key;
                });
                return shapes.enter().append("rect").attr("class", function(d) {
                    return itemCS.class.concat(d.highlight ? " highlight" : "");
                }), shapes.style("fill", function(d) {
                    return d.color;
                }).style("fill-opacity", function(d) {
                    return visuals.ColumnUtil.getFillOpacity(d.selected, d.highlight, !1, data.hasHighlights);
                }).transition().duration(this.animationDuration).attr(layout.shapeLayout), shapes.exit().remove(), 
                shapes;
            }, WebColumnChartAnimator;
        }(visuals.BaseAnimator);
        visuals.WebColumnChartAnimator = WebColumnChartAnimator;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var ColumnChartWebBehavior = function() {
            function ColumnChartWebBehavior() {}
            return ColumnChartWebBehavior.prototype.bindEvents = function(options, selectionHandler) {
                this.options = options;
                var eventGroup = options.columnChartDrawInfo.eventGroup;
                eventGroup.on("click", function() {
                    var position = visuals.InteractivityUtils.getPositionOfLastInputEvent();
                    visuals.InteractivityUtils.tryToSelectD3Target(function(d) {
                        return selectionHandler.handleSelection(d, d3.event.ctrlKey, position);
                    });
                }), eventGroup.on("contextmenu", function() {
                    if (!d3.event.ctrlKey) {
                        d3.event.preventDefault();
                        var position = visuals.InteractivityUtils.getPositionOfLastInputEvent();
                        visuals.InteractivityUtils.tryToSelectD3Target(function(d) {
                            return selectionHandler.handleContextMenu(d, position);
                        });
                    }
                });
            }, ColumnChartWebBehavior.prototype.renderSelection = function(hasSelection) {
                var options = this.options;
                if (options.columnChartDrawInfo.ribbonChartEventGroup) {
                    var bandsOpacity = (100 - options.bandsTransparency) / 100;
                    options.columnChartDrawInfo.ribbonChartEventGroup.style("fill-opacity", visuals.ColumnUtil.getFillOpacity(!1, !1, hasSelection, options.hasHighlights, bandsOpacity));
                }
                options.columnChartDrawInfo.shapesSelection.style("fill-opacity", function(d) {
                    return visuals.ColumnUtil.getFillOpacity(d.selected, d.highlight, !d.highlight && hasSelection, !d.selected && options.hasHighlights);
                });
            }, ColumnChartWebBehavior;
        }();
        visuals.ColumnChartWebBehavior = ColumnChartWebBehavior;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var ClusteredColumnChartStrategy = function() {
            function ClusteredColumnChartStrategy() {}
            return ClusteredColumnChartStrategy.prototype.setupVisualProps = function(columnChartProps) {
                this.graphicsContext = columnChartProps, this.margin = columnChartProps.margin, 
                this.width = this.graphicsContext.width, this.height = this.graphicsContext.height, 
                this.categoryLayout = columnChartProps.layout, this.animator = columnChartProps.animator, 
                this.interactivityService = columnChartProps.interactivityService, this.viewportHeight = columnChartProps.viewportHeight, 
                this.viewportWidth = columnChartProps.viewportWidth, this.isComboChart = columnChartProps.isComboChart;
            }, ClusteredColumnChartStrategy.prototype.setData = function(data) {
                this.data = data;
            }, ClusteredColumnChartStrategy.prototype.setXScale = function(axisScaleProps) {
                var forcedXMin, forcedXMax, forcedXDomain = axisScaleProps.forcedXDomain, axisScaleType = axisScaleProps.axisScaleType, axisDisplayUnits = axisScaleProps.axisDisplayUnits, axisPrecision = axisScaleProps.axisPrecision, ensureXDomain = axisScaleProps.ensureXDomain, margin = axisScaleProps.margin, width = this.width;
                forcedXDomain && 2 === forcedXDomain.length && (forcedXMin = forcedXDomain[0], forcedXMax = forcedXDomain[1]);
                var props = this.xProps = visuals.ColumnUtil.getCategoryAxis(this.data, width, this.categoryLayout, !1, forcedXMin, forcedXMax, axisScaleType, axisDisplayUnits, axisPrecision, ensureXDomain, margin, axisScaleProps.preventNice), seriesLength = this.data.series.length, columnWidth = this.categoryLayout.categoryThickness * (1 - axisScaleProps.innerPaddingRatio) / seriesLength;
                return this.seriesOffsetScale = d3.scale.ordinal().domain(this.data.series.map(function(s) {
                    return s.index;
                })).rangeBands([ 0, seriesLength * columnWidth ]), props;
            }, ClusteredColumnChartStrategy.prototype.setYScale = function(axisScaleProps) {
                var forcedTickCount = (axisScaleProps.is100Pct, axisScaleProps.forcedTickCount), forcedYDomain = axisScaleProps.forcedYDomain, axisScaleType = axisScaleProps.axisScaleType, axisDisplayUnits = axisScaleProps.axisDisplayUnits, axisPrecision = axisScaleProps.axisPrecision, ensureYDomain = axisScaleProps.ensureYDomain, outerPaddingRatio = axisScaleProps.outerPaddingRatio, margin = axisScaleProps.margin, height = this.viewportHeight, valueDomain = visuals.AxisHelper.createValueDomain(this.data.series, !0) || visuals.emptyDomain, combinedDomain = visuals.AxisHelper.combineDomain(forcedYDomain, valueDomain, ensureYDomain), shouldClamp = visuals.AxisHelper.scaleShouldClamp(combinedDomain, valueDomain);
                return this.yProps = visuals.AxisHelper.createAxis({
                    pixelSpan: height,
                    dataDomain: combinedDomain,
                    zeroScalarDomain: [ 0, 1 ],
                    metaDataColumn: this.data.valuesMetadata,
                    formatString: visuals.valueFormatter.getFormatString(this.data.valuesMetadata[0], visuals.columnChartProps.general.formatString),
                    outerPadding: 0,
                    isScalar: !0,
                    isVertical: !0,
                    forcedTickCount: forcedTickCount,
                    useTickIntervalForDisplayUnits: !0,
                    isCategoryAxis: !1,
                    scaleType: axisScaleType,
                    axisDisplayUnits: axisDisplayUnits,
                    axisPrecision: axisPrecision,
                    shouldClamp: shouldClamp,
                    outerPaddingRatio: outerPaddingRatio,
                    margin: margin,
                    preventNice: axisScaleProps.preventNice
                }), this.yProps;
            }, ClusteredColumnChartStrategy.prototype.createLabelDataPoints = function() {
                return visuals.ColumnUtil.createLabelDataPoints(this.data, this.layout, this.graphicsContext, this.yProps, !1, !0);
            }, ClusteredColumnChartStrategy.prototype.drawColumns = function(useAnimation) {
                var data = this.data;
                this.columnsCenters = null;
                var labelDataPointGroups, categoryWidth = this.categoryLayout.categoryThickness * (1 - this.categoryLayout.innerPaddingRatio), columnWidth = categoryWidth / data.series.length, axisOptions = {
                    columnWidth: columnWidth,
                    categoryWidth: categoryWidth,
                    xScale: this.xProps.scale,
                    yScale: this.yProps.scale,
                    seriesOffsetScale: this.seriesOffsetScale,
                    isScalar: this.categoryLayout.isScalar,
                    margin: this.margin
                }, clusteredColumnLayout = this.layout = ClusteredColumnChartStrategy.getLayout(data, axisOptions), dataLabelSettings = data.dataLabelsSettings;
                dataLabelSettings && dataLabelSettings.show && (labelDataPointGroups = this.createLabelDataPoints());
                var result, shapes, series = visuals.ColumnUtil.drawSeries(data, this.graphicsContext.mainGraphicsContext, axisOptions);
                return this.animator && useAnimation && (result = this.animator.animate({
                    viewModel: data,
                    series: series,
                    layout: clusteredColumnLayout,
                    itemCS: ClusteredColumnChartStrategy.classes.item,
                    interactivityService: this.interactivityService,
                    mainGraphicsContext: this.graphicsContext.mainGraphicsContext,
                    viewPort: {
                        height: this.height,
                        width: this.width
                    }
                }), shapes = result.shapes), this.animator && useAnimation && !result.failed || (shapes = visuals.ColumnUtil.drawDefaultShapes(data, series, clusteredColumnLayout, ClusteredColumnChartStrategy.classes.item, !this.animator, this.interactivityService && this.interactivityService.hasSelection())), 
                visuals.ColumnUtil.applyInteractivity(shapes, this.graphicsContext.onDragStart), 
                {
                    eventGroup: this.graphicsContext.mainGraphicsContext,
                    shapesSelection: shapes,
                    viewport: {
                        height: this.height,
                        width: this.width
                    },
                    axisOptions: axisOptions,
                    labelDataPointGroups: labelDataPointGroups,
                    animateLabels: result && !result.failed
                };
            }, ClusteredColumnChartStrategy.prototype.selectColumn = function(selectedColumnIndex, lastSelectedColumnIndex, forceDimAll, innerPaddingRatio) {
                visuals.ColumnUtil.setSelectedColumnOpacity(this.graphicsContext.mainGraphicsContext, ClusteredColumnChartStrategy.classes.item.selector, selectedColumnIndex, lastSelectedColumnIndex, forceDimAll), 
                this.moveHandle(selectedColumnIndex, innerPaddingRatio);
            }, ClusteredColumnChartStrategy.prototype.getClosestColumnIndex = function(x, y, innerPaddingRatio) {
                return visuals.ColumnUtil.getClosestColumnIndex(x, this.getColumnsCenters(innerPaddingRatio));
            }, ClusteredColumnChartStrategy.prototype.getColumnsCenters = function(innerPaddingRatio) {
                var _this = this;
                if (!this.columnsCenters) {
                    var categoryWidth = this.categoryLayout.categoryThickness * (1 - innerPaddingRatio);
                    if (this.data.series.length > 0) {
                        var xScaleOffset_1 = 0;
                        this.categoryLayout.isScalar || (xScaleOffset_1 = categoryWidth / 2);
                        var firstSeries = this.data.series[0];
                        this.columnsCenters = firstSeries.data.map(function(d) {
                            return _this.xProps.scale(_this.categoryLayout.isScalar ? d.categoryValue : d.categoryIndex) + xScaleOffset_1;
                        });
                    }
                }
                return this.columnsCenters;
            }, ClusteredColumnChartStrategy.prototype.moveHandle = function(selectedColumnIndex, innerPaddingRatio) {
                var columnCenters = this.getColumnsCenters(innerPaddingRatio), hoverLine = d3.select(".interactive-hover-line");
                if (hoverLine.empty() || this.columnSelectionLineHandle || (this.columnSelectionLineHandle = d3.select(hoverLine.node().parentNode)), 
                !columnCenters || columnCenters.length <= 1) return void (this.columnSelectionLineHandle && this.columnSelectionLineHandle.remove());
                var x = columnCenters[selectedColumnIndex];
                if (this.columnSelectionLineHandle) {
                    var handle = this.columnSelectionLineHandle;
                    handle.select("line").attr({
                        x1: x,
                        x2: x
                    }), handle.select("circle").attr({
                        cx: x
                    });
                } else {
                    var handle = this.columnSelectionLineHandle = this.graphicsContext.unclippedGraphicsContext.append("g");
                    handle.append("line").classed("interactive-hover-line", !0).attr({
                        x1: x,
                        x2: x,
                        y1: 0,
                        y2: this.height
                    }), handle.append("circle").attr({
                        cx: x,
                        cy: this.height,
                        r: "6px"
                    }).classed("drag-handle", !0);
                }
            }, ClusteredColumnChartStrategy.getLayout = function(data, axisOptions) {
                var columnWidth = axisOptions.columnWidth, halfColumnWidth = .5 * columnWidth, quarterColumnWidth = halfColumnWidth / 2, isScalar = axisOptions.isScalar, xScale = axisOptions.xScale, yScale = axisOptions.yScale, seriesOffsetScale = axisOptions.seriesOffsetScale, scaledY0 = yScale(0), xScaleOffset = 0;
                return isScalar && (xScaleOffset = axisOptions.categoryWidth / 2), {
                    shapeLayout: {
                        width: function(d) {
                            return d.drawThinner ? halfColumnWidth : columnWidth;
                        },
                        x: function(d) {
                            return xScale(isScalar ? d.categoryValue : d.categoryIndex) + seriesOffsetScale(d.seriesIndex) - xScaleOffset + (d.drawThinner ? quarterColumnWidth : 0);
                        },
                        y: function(d) {
                            return scaledY0 + visuals.AxisHelper.diffScaled(yScale, Math.max(0, d.value), 0);
                        },
                        height: function(d) {
                            return Math.abs(visuals.AxisHelper.diffScaled(yScale, 0, d.value));
                        }
                    },
                    shapeLayoutWithoutHighlights: {
                        width: function(d) {
                            return columnWidth;
                        },
                        x: function(d) {
                            return xScale(isScalar ? d.categoryValue : d.categoryIndex) + seriesOffsetScale(d.seriesIndex) - xScaleOffset;
                        },
                        y: function(d) {
                            return scaledY0 + visuals.AxisHelper.diffScaled(yScale, Math.max(0, d.originalValue), 0);
                        },
                        height: function(d) {
                            return Math.abs(visuals.AxisHelper.diffScaled(yScale, 0, d.originalValue));
                        }
                    },
                    zeroShapeLayout: {
                        width: function(d) {
                            return d.drawThinner ? halfColumnWidth : columnWidth;
                        },
                        x: function(d) {
                            return xScale(isScalar ? d.categoryValue : d.categoryIndex) + seriesOffsetScale(d.seriesIndex) - xScaleOffset + (d.drawThinner ? quarterColumnWidth : 0);
                        },
                        y: function(d) {
                            return scaledY0;
                        },
                        height: function(d) {
                            return 0;
                        }
                    }
                };
            }, ClusteredColumnChartStrategy.classes = {
                item: {
                    class: "column",
                    selector: ".column"
                }
            }, ClusteredColumnChartStrategy;
        }();
        visuals.ClusteredColumnChartStrategy = ClusteredColumnChartStrategy;
        var ClusteredBarChartStrategy = function() {
            function ClusteredBarChartStrategy() {}
            return ClusteredBarChartStrategy.prototype.setupVisualProps = function(barChartProps) {
                this.graphicsContext = barChartProps, this.margin = barChartProps.margin, this.width = this.graphicsContext.width, 
                this.height = this.graphicsContext.height, this.categoryLayout = barChartProps.layout, 
                this.animator = barChartProps.animator, this.interactivityService = barChartProps.interactivityService, 
                this.viewportHeight = barChartProps.viewportHeight, this.viewportWidth = barChartProps.viewportWidth, 
                this.isComboChart = barChartProps.isComboChart;
            }, ClusteredBarChartStrategy.prototype.setData = function(data) {
                this.data = data;
            }, ClusteredBarChartStrategy.prototype.setYScale = function(axisScaleProps) {
                var forcedYMin, forcedYMax, forcedYDomain = axisScaleProps.forcedYDomain, axisScaleType = axisScaleProps.axisScaleType, axisDisplayUnits = axisScaleProps.axisDisplayUnits, axisPrecision = axisScaleProps.axisPrecision, ensureYDomain = axisScaleProps.ensureYDomain, margin = axisScaleProps.margin, height = this.height;
                forcedYDomain && 2 === forcedYDomain.length && (forcedYMin = forcedYDomain[0], forcedYMax = forcedYDomain[1]);
                var props = this.yProps = visuals.ColumnUtil.getCategoryAxis(this.data, height, this.categoryLayout, !0, forcedYMin, forcedYMax, axisScaleType, axisDisplayUnits, axisPrecision, ensureYDomain, margin, axisScaleProps.preventNice), seriesLength = this.data.series.length, columnWidth = this.categoryLayout.categoryThickness * (1 - axisScaleProps.innerPaddingRatio) / seriesLength;
                return this.seriesOffsetScale = d3.scale.ordinal().domain(this.data.series.map(function(s) {
                    return s.index;
                })).rangeBands([ 0, seriesLength * columnWidth ]), props;
            }, ClusteredBarChartStrategy.prototype.setXScale = function(axisScaleProps) {
                var forcedTickCount = (axisScaleProps.is100Pct, axisScaleProps.forcedTickCount), forcedXDomain = axisScaleProps.forcedXDomain, axisScaleType = axisScaleProps.axisScaleType, axisDisplayUnits = axisScaleProps.axisDisplayUnits, axisPrecision = axisScaleProps.axisPrecision, ensureXDomain = axisScaleProps.ensureXDomain, outerPaddingRatio = axisScaleProps.outerPaddingRatio, margin = axisScaleProps.margin, width = this.width, valueDomain = visuals.AxisHelper.createValueDomain(this.data.series, !0) || visuals.emptyDomain, combinedDomain = visuals.AxisHelper.combineDomain(forcedXDomain, valueDomain, ensureXDomain), shouldClamp = visuals.AxisHelper.scaleShouldClamp(combinedDomain, valueDomain);
                return this.xProps = visuals.AxisHelper.createAxis({
                    pixelSpan: width,
                    dataDomain: combinedDomain,
                    zeroScalarDomain: [ 0, 1 ],
                    metaDataColumn: this.data.valuesMetadata,
                    formatString: visuals.valueFormatter.getFormatString(this.data.valuesMetadata[0], visuals.columnChartProps.general.formatString),
                    outerPadding: 0,
                    isScalar: !0,
                    isVertical: !1,
                    forcedTickCount: forcedTickCount,
                    useTickIntervalForDisplayUnits: !0,
                    isCategoryAxis: !1,
                    scaleType: axisScaleType,
                    axisDisplayUnits: axisDisplayUnits,
                    axisPrecision: axisPrecision,
                    shouldClamp: shouldClamp,
                    outerPaddingRatio: outerPaddingRatio,
                    margin: margin,
                    preventNice: axisScaleProps.preventNice
                }), this.xProps.axis.tickSize(-this.viewportHeight, 0), this.xProps;
            }, ClusteredBarChartStrategy.prototype.createLabelDataPoints = function() {
                return visuals.ColumnUtil.createLabelDataPoints(this.data, this.layout, this.graphicsContext, this.xProps, !0, !0);
            }, ClusteredBarChartStrategy.prototype.drawColumns = function(useAnimation) {
                var data = this.data;
                this.barsCenters = null;
                var labelDataPointGroups, categoryWidth = this.categoryLayout.categoryThickness * (1 - this.categoryLayout.innerPaddingRatio), columnWidth = categoryWidth / data.series.length, axisOptions = {
                    columnWidth: columnWidth,
                    categoryWidth: categoryWidth,
                    xScale: this.xProps.scale,
                    yScale: this.yProps.scale,
                    seriesOffsetScale: this.seriesOffsetScale,
                    isScalar: this.categoryLayout.isScalar,
                    margin: this.margin
                }, clusteredBarLayout = this.layout = ClusteredBarChartStrategy.getLayout(data, axisOptions), dataLabelSettings = data.dataLabelsSettings;
                dataLabelSettings && dataLabelSettings.show && (labelDataPointGroups = this.createLabelDataPoints());
                var result, shapes, series = visuals.ColumnUtil.drawSeries(data, this.graphicsContext.mainGraphicsContext, axisOptions);
                return this.animator && useAnimation && (result = this.animator.animate({
                    viewModel: data,
                    series: series,
                    layout: clusteredBarLayout,
                    itemCS: ClusteredBarChartStrategy.classes.item,
                    interactivityService: this.interactivityService,
                    mainGraphicsContext: this.graphicsContext.mainGraphicsContext,
                    viewPort: {
                        height: this.height,
                        width: this.width
                    }
                }), shapes = result.shapes), this.animator && useAnimation && !result.failed || (shapes = visuals.ColumnUtil.drawDefaultShapes(data, series, clusteredBarLayout, ClusteredBarChartStrategy.classes.item, !this.animator, this.interactivityService && this.interactivityService.hasSelection())), 
                visuals.ColumnUtil.applyInteractivity(shapes, this.graphicsContext.onDragStart), 
                {
                    eventGroup: this.graphicsContext.mainGraphicsContext,
                    shapesSelection: shapes,
                    viewport: {
                        height: this.height,
                        width: this.width
                    },
                    axisOptions: axisOptions,
                    labelDataPointGroups: labelDataPointGroups,
                    animateLabels: result && !result.failed
                };
            }, ClusteredBarChartStrategy.prototype.selectColumn = function(selectedColumnIndex, lastSelectedColumnIndex, forceDimAll, innerPaddingRatio) {
                visuals.ColumnUtil.setSelectedColumnOpacity(this.graphicsContext.mainGraphicsContext, ClusteredBarChartStrategy.classes.item.selector, selectedColumnIndex, lastSelectedColumnIndex, forceDimAll), 
                this.moveHandle(selectedColumnIndex, innerPaddingRatio);
            }, ClusteredBarChartStrategy.prototype.getClosestColumnIndex = function(x, y, innerPaddingRatio) {
                return visuals.ColumnUtil.getClosestColumnIndex(y, this.getBarsCenters(innerPaddingRatio));
            }, ClusteredBarChartStrategy.prototype.getBarsCenters = function(innerPaddingRatio) {
                var _this = this;
                if (!this.barsCenters) {
                    var barWidth = this.categoryLayout.categoryThickness * (1 - innerPaddingRatio);
                    if (this.data.series.length > 0) {
                        var yScaleOffset_1 = 0;
                        this.categoryLayout.isScalar || (yScaleOffset_1 = barWidth / 2);
                        var firstSeries = this.data.series[0];
                        this.barsCenters = firstSeries.data.map(function(d) {
                            return _this.yProps.scale(_this.categoryLayout.isScalar ? d.categoryValue : d.categoryIndex) + yScaleOffset_1;
                        });
                    }
                }
                return this.barsCenters;
            }, ClusteredBarChartStrategy.prototype.moveHandle = function(selectedColumnIndex, innerPaddingRatio) {
                var barCenters = this.getBarsCenters(innerPaddingRatio), hoverLine = d3.select(".interactive-hover-line");
                if (hoverLine.empty() || this.columnSelectionLineHandle || (this.columnSelectionLineHandle = d3.select(hoverLine.node().parentNode)), 
                !barCenters || barCenters.length <= 1) return void (this.columnSelectionLineHandle && this.columnSelectionLineHandle.remove());
                var y = barCenters[selectedColumnIndex];
                if (this.columnSelectionLineHandle) {
                    var handle = this.columnSelectionLineHandle;
                    handle.select("line").attr({
                        y1: y,
                        y2: y
                    }), handle.select("circle").attr({
                        cy: y
                    });
                } else {
                    var handle = this.columnSelectionLineHandle = this.graphicsContext.unclippedGraphicsContext.append("g");
                    handle.append("line").classed("interactive-hover-line", !0).attr({
                        x1: 0,
                        x2: this.width,
                        y1: y,
                        y2: y
                    }), handle.append("circle").attr({
                        cx: 0,
                        cy: y,
                        r: "6px"
                    }).classed("drag-handle", !0);
                }
            }, ClusteredBarChartStrategy.getLayout = function(data, axisOptions) {
                var columnWidth = axisOptions.columnWidth, halfColumnWidth = .5 * columnWidth, quarterColumnWidth = halfColumnWidth / 2, isScalar = axisOptions.isScalar, xScale = axisOptions.xScale, yScale = axisOptions.yScale, seriesOffsetScale = axisOptions.seriesOffsetScale, scaledX0 = xScale(0), yScaleOffset = 0;
                return isScalar && (yScaleOffset = axisOptions.categoryWidth / 2), {
                    shapeLayout: {
                        width: function(d) {
                            return Math.abs(visuals.AxisHelper.diffScaled(xScale, 0, d.value));
                        },
                        x: function(d) {
                            return scaledX0 + visuals.AxisHelper.diffScaled(xScale, Math.min(0, d.value), 0);
                        },
                        y: function(d) {
                            return yScale(isScalar ? d.categoryValue : d.categoryIndex) + seriesOffsetScale(d.seriesIndex) - yScaleOffset + (d.drawThinner ? quarterColumnWidth : 0);
                        },
                        height: function(d) {
                            return d.drawThinner ? halfColumnWidth : columnWidth;
                        }
                    },
                    shapeLayoutWithoutHighlights: {
                        width: function(d) {
                            return Math.abs(visuals.AxisHelper.diffScaled(xScale, 0, d.originalValue));
                        },
                        x: function(d) {
                            return scaledX0 + visuals.AxisHelper.diffScaled(xScale, Math.min(0, d.originalValue), 0);
                        },
                        y: function(d) {
                            return yScale(isScalar ? d.categoryValue : d.categoryIndex) + seriesOffsetScale(d.seriesIndex) - yScaleOffset;
                        },
                        height: function(d) {
                            return columnWidth;
                        }
                    },
                    zeroShapeLayout: {
                        width: function(d) {
                            return 0;
                        },
                        x: function(d) {
                            return scaledX0 + visuals.AxisHelper.diffScaled(xScale, Math.min(0, d.value), 0);
                        },
                        y: function(d) {
                            return yScale(isScalar ? d.categoryValue : d.categoryIndex) + seriesOffsetScale(d.seriesIndex) - yScaleOffset + (d.drawThinner ? quarterColumnWidth : 0);
                        },
                        height: function(d) {
                            return d.drawThinner ? halfColumnWidth : columnWidth;
                        }
                    }
                };
            }, ClusteredBarChartStrategy.classes = {
                item: {
                    class: "bar",
                    selector: ".bar"
                }
            }, ClusteredBarChartStrategy;
        }();
        visuals.ClusteredBarChartStrategy = ClusteredBarChartStrategy;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var StackedColumnChartStrategy = function() {
            function StackedColumnChartStrategy() {}
            return StackedColumnChartStrategy.prototype.setupVisualProps = function(columnChartProps) {
                this.graphicsContext = columnChartProps, this.margin = columnChartProps.margin, 
                this.width = this.graphicsContext.width, this.height = this.graphicsContext.height, 
                this.categoryLayout = columnChartProps.layout, this.animator = columnChartProps.animator, 
                this.interactivityService = columnChartProps.interactivityService, this.viewportHeight = columnChartProps.viewportHeight, 
                this.viewportWidth = columnChartProps.viewportWidth, this.isComboChart = columnChartProps.isComboChart;
            }, StackedColumnChartStrategy.prototype.setData = function(data) {
                this.data = data;
            }, StackedColumnChartStrategy.prototype.setXScale = function(axisScaleProps) {
                var forcedXMin, forcedXMax, forcedXDomain = axisScaleProps.forcedXDomain, axisScaleType = axisScaleProps.axisScaleType, axisDisplayUnits = axisScaleProps.axisDisplayUnits, axisPrecision = axisScaleProps.axisPrecision, xReferenceLineValue = axisScaleProps.xReferenceLineValue, margin = axisScaleProps.margin, width = this.width;
                forcedXDomain && 2 === forcedXDomain.length && (forcedXMin = forcedXDomain[0], forcedXMax = forcedXDomain[1]);
                var props = this.xProps = visuals.ColumnUtil.getCategoryAxis(this.data, width, this.categoryLayout, !1, forcedXMin, forcedXMax, axisScaleType, axisDisplayUnits, axisPrecision, xReferenceLineValue, margin, axisScaleProps.preventNice, axisScaleProps.innerPaddingRatio);
                return props;
            }, StackedColumnChartStrategy.prototype.setYScale = function(axisScaleProps) {
                var is100Pct = axisScaleProps.is100Pct, forcedTickCount = axisScaleProps.forcedTickCount, forcedYDomain = axisScaleProps.forcedYDomain, axisScaleType = axisScaleProps.axisScaleType, axisDisplayUnits = axisScaleProps.axisDisplayUnits, axisPrecision = axisScaleProps.axisPrecision, y1ReferenceLineValue = axisScaleProps.yReferenceLineValue, outerPaddingRatio = axisScaleProps.outerPaddingRatio, margin = axisScaleProps.margin, height = this.viewportHeight, valueDomain = visuals.StackedUtil.calcValueDomain(this.data.series, is100Pct), valueDomainArr = [ valueDomain.min, valueDomain.max ], combinedDomain = visuals.AxisHelper.combineDomain(forcedYDomain, valueDomainArr, y1ReferenceLineValue), shouldClamp = visuals.AxisHelper.scaleShouldClamp(combinedDomain, valueDomainArr), metadataColumn = this.data.valuesMetadata[0], formatString = is100Pct ? this.graphicsContext.hostService.getLocalizedString("Percentage") : visuals.valueFormatter.getFormatString(metadataColumn, visuals.columnChartProps.general.formatString);
                return this.yProps = visuals.AxisHelper.createAxis({
                    pixelSpan: height,
                    dataDomain: combinedDomain,
                    zeroScalarDomain: [ 0, 1 ],
                    metaDataColumn: this.data.valuesMetadata,
                    formatString: formatString,
                    outerPadding: 0,
                    outerPaddingRatio: outerPaddingRatio,
                    isScalar: !0,
                    isVertical: !0,
                    forcedTickCount: forcedTickCount,
                    useTickIntervalForDisplayUnits: !0,
                    isCategoryAxis: !1,
                    scaleType: axisScaleType,
                    axisDisplayUnits: axisDisplayUnits,
                    axisPrecision: axisPrecision,
                    is100Pct: is100Pct,
                    shouldClamp: shouldClamp,
                    margin: margin,
                    preventNice: axisScaleProps.preventNice
                }), this.yProps;
            }, StackedColumnChartStrategy.prototype.createLabelDataPoints = function() {
                return visuals.ColumnUtil.createLabelDataPoints(this.data, this.layout, this.graphicsContext, this.yProps, !1, !1);
            }, StackedColumnChartStrategy.prototype.drawColumns = function(useAnimation) {
                var data = this.data;
                this.columnsCenters = null;
                var labelDataPointGroups, axisOptions = {
                    columnWidth: this.categoryLayout.categoryThickness * (1 - this.categoryLayout.innerPaddingRatio),
                    xScale: this.xProps.scale,
                    yScale: this.yProps.scale,
                    isScalar: this.categoryLayout.isScalar,
                    margin: this.margin
                }, stackedColumnLayout = this.layout = StackedColumnChartStrategy.getLayout(data, axisOptions), dataLabelSettings = data.dataLabelsSettings;
                dataLabelSettings && dataLabelSettings.show && (labelDataPointGroups = this.createLabelDataPoints());
                var result, shapes, series = visuals.ColumnUtil.drawSeries(data, this.graphicsContext.mainGraphicsContext, axisOptions);
                this.animator && useAnimation && (result = this.animator.animate({
                    viewModel: data,
                    series: series,
                    layout: stackedColumnLayout,
                    itemCS: StackedColumnChartStrategy.classes.item,
                    interactivityService: this.interactivityService,
                    mainGraphicsContext: this.graphicsContext.mainGraphicsContext,
                    viewPort: {
                        height: this.height,
                        width: this.width
                    }
                }), shapes = result.shapes), this.animator && useAnimation && !result.failed || (shapes = visuals.ColumnUtil.drawDefaultShapes(data, series, stackedColumnLayout, StackedColumnChartStrategy.classes.item, !this.animator, this.interactivityService && this.interactivityService.hasSelection()));
                var options, ribbonChartEventGroup, ribbonChartData = this.data.ribbonChartData;
                if (ribbonChartData && ribbonChartData.ribbonChartDataPoints) {
                    var ribbonChartAreaLayout = visuals.ColumnChart.getRibbonsUtils().getRibbonChartAreaLayout(this.layout, ribbonChartData.ribbonChartDataPoints, !0);
                    options = {
                        graphicsContext: this.graphicsContext.mainGraphicsContext,
                        layout: ribbonChartAreaLayout,
                        ribbonChartAreaSelector: visuals.ColumnChart.RibbonChartItemClasses,
                        ribbonChartGroupSelector: visuals.ColumnChart.RibbonChartLayerClasses,
                        isColumn: !0,
                        colorBands: ribbonChartData.ribbonOptions.colorBands,
                        bandsTransparency: ribbonChartData.ribbonOptions.bandsTransparency,
                        showBorder: ribbonChartData.ribbonOptions.showBorder
                    }, ribbonChartEventGroup = visuals.ColumnChart.getRibbonsUtils().drawRibbonChartAreaSmooth(options);
                } else options = {
                    graphicsContext: this.graphicsContext.mainGraphicsContext,
                    layout: [],
                    ribbonChartAreaSelector: visuals.ColumnChart.RibbonChartItemClasses,
                    ribbonChartGroupSelector: visuals.ColumnChart.RibbonChartLayerClasses,
                    isColumn: !0,
                    colorBands: !1,
                    bandsTransparency: StackedColumnChartStrategy.defaultBandsTransparency,
                    showBorder: !1
                }, ribbonChartEventGroup = visuals.ColumnChart.getRibbonsUtils().drawRibbonChartAreaSmooth(options);
                return visuals.ColumnUtil.applyInteractivity(shapes, this.graphicsContext.onDragStart), 
                {
                    eventGroup: this.graphicsContext.mainGraphicsContext,
                    ribbonChartEventGroup: ribbonChartEventGroup,
                    shapesSelection: shapes,
                    viewport: {
                        height: this.height,
                        width: this.width
                    },
                    axisOptions: axisOptions,
                    labelDataPointGroups: labelDataPointGroups,
                    animateLabels: result && !result.failed
                };
            }, StackedColumnChartStrategy.prototype.selectColumn = function(selectedColumnIndex, lastSelectedColumnIndex, forceDimAll, innerPaddingRatio) {
                visuals.ColumnUtil.setSelectedColumnOpacity(this.graphicsContext.mainGraphicsContext, StackedColumnChartStrategy.classes.item.selector, selectedColumnIndex, lastSelectedColumnIndex, forceDimAll), 
                this.moveHandle(selectedColumnIndex, innerPaddingRatio);
            }, StackedColumnChartStrategy.prototype.getClosestColumnIndex = function(x, y, innerPaddingRatio) {
                return visuals.ColumnUtil.getClosestColumnIndex(x, this.getColumnsCenters(innerPaddingRatio));
            }, StackedColumnChartStrategy.prototype.getColumnsCenters = function(innerPaddingRatio) {
                var _this = this;
                if (!this.columnsCenters) {
                    var categoryWidth = this.categoryLayout.categoryThickness * (1 - innerPaddingRatio);
                    if (this.data.series.length > 0) {
                        var xScaleOffset_2 = 0;
                        this.categoryLayout.isScalar || (xScaleOffset_2 = categoryWidth / 2);
                        var firstSeries = this.data.series[0];
                        this.columnsCenters = firstSeries.data.map(function(d) {
                            return _this.xProps.scale(_this.categoryLayout.isScalar ? d.categoryValue : d.categoryIndex) + xScaleOffset_2;
                        });
                    }
                }
                return this.columnsCenters;
            }, StackedColumnChartStrategy.prototype.moveHandle = function(selectedColumnIndex, innerPaddingRatio) {
                var columnCenters = this.getColumnsCenters(innerPaddingRatio), hoverLine = d3.select(".interactive-hover-line");
                if (hoverLine.empty() || this.columnSelectionLineHandle || (this.columnSelectionLineHandle = d3.select(hoverLine.node().parentNode)), 
                !columnCenters || columnCenters.length <= 1) return void (this.columnSelectionLineHandle && this.columnSelectionLineHandle.remove());
                var x = columnCenters[selectedColumnIndex];
                if (this.columnSelectionLineHandle) {
                    var handle = this.columnSelectionLineHandle;
                    handle.select("line").attr({
                        x1: x,
                        x2: x
                    }), handle.select("circle").attr({
                        cx: x
                    });
                } else {
                    var handle = this.columnSelectionLineHandle = this.graphicsContext.unclippedGraphicsContext.append("g");
                    handle.append("line").classed("interactive-hover-line", !0).attr({
                        x1: x,
                        x2: x,
                        y1: 0,
                        y2: this.height
                    }), handle.append("circle").attr({
                        cx: x,
                        cy: this.height,
                        r: "6px"
                    }).classed("drag-handle", !0);
                }
            }, StackedColumnChartStrategy.getLayout = function(data, axisOptions) {
                var columnWidth = axisOptions.columnWidth, isScalar = axisOptions.isScalar, xScale = axisOptions.xScale, yScale = axisOptions.yScale, xScaleOffset = 0;
                return isScalar && (xScaleOffset = columnWidth / 2), {
                    shapeLayout: {
                        width: function(d) {
                            return columnWidth;
                        },
                        x: function(d) {
                            return xScale(isScalar ? d.categoryValue : d.categoryIndex) - xScaleOffset;
                        },
                        y: function(d) {
                            return yScale(d.position);
                        },
                        height: function(d) {
                            return yScale(d.position - d.valueAbsolute) - yScale(d.position);
                        }
                    },
                    shapeLayoutWithoutHighlights: {
                        width: function(d) {
                            return columnWidth;
                        },
                        x: function(d) {
                            return xScale(isScalar ? d.categoryValue : d.categoryIndex) - xScaleOffset;
                        },
                        y: function(d) {
                            return yScale(d.originalPosition);
                        },
                        height: function(d) {
                            return yScale(d.originalPosition - d.originalValueAbsolute) - yScale(d.originalPosition);
                        }
                    },
                    zeroShapeLayout: {
                        width: function(d) {
                            return columnWidth;
                        },
                        x: function(d) {
                            return xScale(isScalar ? d.categoryValue : d.categoryIndex) - xScaleOffset;
                        },
                        y: function(d) {
                            return yScale(d.value >= 0 ? d.position - d.valueAbsolute : d.position);
                        },
                        height: function(d) {
                            return 0;
                        }
                    }
                };
            }, StackedColumnChartStrategy.classes = {
                item: {
                    class: "column",
                    selector: ".column"
                },
                highlightItem: {
                    class: "highlightColumn",
                    selector: ".highlightColumn"
                }
            }, StackedColumnChartStrategy.defaultBandsTransparency = 30, StackedColumnChartStrategy;
        }();
        visuals.StackedColumnChartStrategy = StackedColumnChartStrategy;
        var StackedBarChartStrategy = function() {
            function StackedBarChartStrategy() {}
            return StackedBarChartStrategy.prototype.setupVisualProps = function(barChartProps) {
                this.graphicsContext = barChartProps, this.margin = barChartProps.margin, this.width = this.graphicsContext.width, 
                this.height = this.graphicsContext.height, this.categoryLayout = barChartProps.layout, 
                this.animator = barChartProps.animator, this.interactivityService = barChartProps.interactivityService, 
                this.viewportHeight = barChartProps.viewportHeight, this.viewportWidth = barChartProps.viewportWidth, 
                this.isComboChart = barChartProps.isComboChart;
            }, StackedBarChartStrategy.prototype.setData = function(data) {
                this.data = data;
            }, StackedBarChartStrategy.prototype.setYScale = function(axisScaleProps) {
                var forcedYMin, forcedYMax, forcedYDomain = axisScaleProps.forcedYDomain, axisScaleType = axisScaleProps.axisScaleType, axisDisplayUnits = axisScaleProps.axisDisplayUnits, axisPrecision = axisScaleProps.axisPrecision, ensureYDomain = axisScaleProps.ensureYDomain, margin = axisScaleProps.margin, height = this.height;
                forcedYDomain && 2 === forcedYDomain.length && (forcedYMin = forcedYDomain[0], forcedYMax = forcedYDomain[1]);
                var props = this.yProps = visuals.ColumnUtil.getCategoryAxis(this.data, height, this.categoryLayout, !0, forcedYMin, forcedYMax, axisScaleType, axisDisplayUnits, axisPrecision, ensureYDomain, margin, axisScaleProps.preventNice);
                return props;
            }, StackedBarChartStrategy.prototype.setXScale = function(axisScaleProps) {
                var is100Pct = axisScaleProps.is100Pct, forcedTickCount = axisScaleProps.forcedTickCount, forcedXDomain = axisScaleProps.forcedXDomain, axisScaleType = axisScaleProps.axisScaleType, axisDisplayUnits = axisScaleProps.axisDisplayUnits, axisPrecision = axisScaleProps.axisPrecision, ensureXDomain = axisScaleProps.ensureXDomain, outerPaddingRatio = axisScaleProps.outerPaddingRatio, margin = axisScaleProps.margin, width = this.width, valueDomain = visuals.StackedUtil.calcValueDomain(this.data.series, is100Pct), valueDomainArr = [ valueDomain.min, valueDomain.max ], combinedDomain = visuals.AxisHelper.combineDomain(forcedXDomain, valueDomainArr, ensureXDomain), shouldClamp = visuals.AxisHelper.scaleShouldClamp(combinedDomain, valueDomainArr), metadataColumn = this.data.valuesMetadata[0], formatString = is100Pct ? this.graphicsContext.hostService.getLocalizedString("Percentage") : visuals.valueFormatter.getFormatString(metadataColumn, visuals.columnChartProps.general.formatString);
                return this.xProps = visuals.AxisHelper.createAxis({
                    pixelSpan: width,
                    dataDomain: combinedDomain,
                    zeroScalarDomain: [ 0, 1 ],
                    metaDataColumn: this.data.valuesMetadata,
                    formatString: formatString,
                    outerPadding: 0,
                    outerPaddingRatio: outerPaddingRatio,
                    isScalar: !0,
                    isVertical: !1,
                    forcedTickCount: forcedTickCount,
                    useTickIntervalForDisplayUnits: !0,
                    isCategoryAxis: !1,
                    scaleType: axisScaleType,
                    axisDisplayUnits: axisDisplayUnits,
                    axisPrecision: axisPrecision,
                    is100Pct: is100Pct,
                    shouldClamp: shouldClamp,
                    margin: margin,
                    preventNice: axisScaleProps.preventNice
                }), this.xProps.axis.tickSize(-this.viewportHeight, 0), this.xProps;
            }, StackedBarChartStrategy.prototype.createLabelDataPoints = function() {
                return visuals.ColumnUtil.createLabelDataPoints(this.data, this.layout, this.graphicsContext, this.xProps, !0, !1);
            }, StackedBarChartStrategy.prototype.drawColumns = function(useAnimation) {
                var data = this.data;
                this.barsCenters = null;
                var labelDataPointGroups, axisOptions = {
                    columnWidth: this.categoryLayout.categoryThickness * (1 - this.categoryLayout.innerPaddingRatio),
                    xScale: this.xProps.scale,
                    yScale: this.yProps.scale,
                    isScalar: this.categoryLayout.isScalar,
                    margin: this.margin
                }, stackedBarLayout = this.layout = StackedBarChartStrategy.getLayout(data, axisOptions), dataLabelSettings = data.dataLabelsSettings;
                dataLabelSettings && dataLabelSettings.show && (labelDataPointGroups = this.createLabelDataPoints());
                var result, shapes, series = visuals.ColumnUtil.drawSeries(data, this.graphicsContext.mainGraphicsContext, axisOptions);
                return this.animator && useAnimation && (result = this.animator.animate({
                    viewModel: data,
                    series: series,
                    layout: stackedBarLayout,
                    itemCS: StackedBarChartStrategy.classes.item,
                    interactivityService: this.interactivityService,
                    mainGraphicsContext: this.graphicsContext.mainGraphicsContext,
                    viewPort: {
                        height: this.height,
                        width: this.width
                    }
                }), shapes = result.shapes), this.animator && useAnimation && !result.failed || (shapes = visuals.ColumnUtil.drawDefaultShapes(data, series, stackedBarLayout, StackedBarChartStrategy.classes.item, !this.animator, this.interactivityService && this.interactivityService.hasSelection())), 
                visuals.ColumnUtil.applyInteractivity(shapes, this.graphicsContext.onDragStart), 
                {
                    eventGroup: this.graphicsContext.mainGraphicsContext,
                    shapesSelection: shapes,
                    viewport: {
                        height: this.height,
                        width: this.width
                    },
                    axisOptions: axisOptions,
                    labelDataPointGroups: labelDataPointGroups,
                    animateLabels: result && !result.failed
                };
            }, StackedBarChartStrategy.prototype.selectColumn = function(selectedColumnIndex, lastSelectedColumnIndex, forceDimAll, innerPaddingRatio) {
                visuals.ColumnUtil.setSelectedColumnOpacity(this.graphicsContext.mainGraphicsContext, StackedBarChartStrategy.classes.item.selector, selectedColumnIndex, lastSelectedColumnIndex, forceDimAll), 
                this.moveHandle(selectedColumnIndex, innerPaddingRatio);
            }, StackedBarChartStrategy.prototype.getClosestColumnIndex = function(x, y, innerPaddingRatio) {
                return visuals.ColumnUtil.getClosestColumnIndex(y, this.getBarsCenters(innerPaddingRatio));
            }, StackedBarChartStrategy.prototype.getBarsCenters = function(innerPaddingRatio) {
                var _this = this;
                if (!this.barsCenters) {
                    var barWidth = this.categoryLayout.categoryThickness * (1 - innerPaddingRatio);
                    if (this.data.series.length > 0) {
                        var yScaleOffset_2 = 0;
                        this.categoryLayout.isScalar || (yScaleOffset_2 = barWidth / 2);
                        var firstSeries = this.data.series[0];
                        this.barsCenters = firstSeries.data.map(function(d) {
                            return _this.yProps.scale(_this.categoryLayout.isScalar ? d.categoryValue : d.categoryIndex) + yScaleOffset_2;
                        });
                    }
                }
                return this.barsCenters;
            }, StackedBarChartStrategy.prototype.moveHandle = function(selectedColumnIndex, innerPaddingRatio) {
                var barCenters = this.getBarsCenters(innerPaddingRatio), hoverLine = d3.select(".interactive-hover-line");
                if (hoverLine.empty() || this.columnSelectionLineHandle || (this.columnSelectionLineHandle = d3.select(hoverLine.node().parentNode)), 
                !barCenters || barCenters.length <= 1) return void (this.columnSelectionLineHandle && this.columnSelectionLineHandle.remove());
                var y = barCenters[selectedColumnIndex];
                if (this.columnSelectionLineHandle) {
                    var handle = this.columnSelectionLineHandle;
                    handle.select("line").attr({
                        y1: y,
                        y2: y
                    }), handle.select("circle").attr({
                        cy: y
                    });
                } else {
                    var handle = this.columnSelectionLineHandle = this.graphicsContext.unclippedGraphicsContext.append("g");
                    handle.append("line").classed("interactive-hover-line", !0).attr({
                        x1: 0,
                        x2: this.width,
                        y1: y,
                        y2: y
                    }), handle.append("circle").classed("drag-handle", !0).attr({
                        cx: 0,
                        cy: y,
                        r: "6px"
                    });
                }
            }, StackedBarChartStrategy.getLayout = function(data, axisOptions) {
                var columnWidth = axisOptions.columnWidth, isScalar = axisOptions.isScalar, xScale = axisOptions.xScale, yScale = axisOptions.yScale, yScaleOffset = 0;
                return isScalar && (yScaleOffset = columnWidth / 2), {
                    shapeLayout: {
                        width: function(d) {
                            return xScale(d.position) - xScale(d.position - d.valueAbsolute);
                        },
                        x: function(d) {
                            return xScale(d.position - d.valueAbsolute);
                        },
                        y: function(d) {
                            return yScale(isScalar ? d.categoryValue : d.categoryIndex) - yScaleOffset;
                        },
                        height: function(d) {
                            return columnWidth;
                        }
                    },
                    shapeLayoutWithoutHighlights: {
                        width: function(d) {
                            return xScale(d.originalPosition) - xScale(d.originalPosition - d.originalValueAbsolute);
                        },
                        x: function(d) {
                            return xScale(d.originalPosition - d.originalValueAbsolute);
                        },
                        y: function(d) {
                            return yScale(isScalar ? d.categoryValue : d.categoryIndex) - yScaleOffset;
                        },
                        height: function(d) {
                            return columnWidth;
                        }
                    },
                    zeroShapeLayout: {
                        width: function(d) {
                            return 0;
                        },
                        x: function(d) {
                            return xScale(d.value >= 0 ? d.position - d.valueAbsolute : d.position);
                        },
                        y: function(d) {
                            return yScale(isScalar ? d.categoryValue : d.categoryIndex) - yScaleOffset;
                        },
                        height: function(d) {
                            return columnWidth;
                        }
                    }
                };
            }, StackedBarChartStrategy.classes = {
                item: {
                    class: "bar",
                    selector: ".bar"
                },
                highlightItem: {
                    class: "highlightBar",
                    selector: ".highlightBar"
                }
            }, StackedBarChartStrategy;
        }();
        visuals.StackedBarChartStrategy = StackedBarChartStrategy;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var ComboChart;
        !function(ComboChart) {
            function enumerateDataPoints(enumeration, options, layers) {
                if (layers) {
                    for (var columnChartLayerIndex, layersLength = layers.length, layerIndex = 0; layerIndex < layersLength; layerIndex++) {
                        var layer = layers[layerIndex];
                        if (layer.enumerateObjectInstances) {
                            if (layer instanceof visuals.ColumnChart) {
                                columnChartLayerIndex = layerIndex;
                                continue;
                            }
                            layer.enumerateObjectInstances(enumeration, options);
                        }
                    }
                    void 0 !== columnChartLayerIndex && layers[columnChartLayerIndex].enumerateObjectInstances(enumeration, options);
                }
            }
            function isComboChart(chartType) {
                return 11 === chartType || 14 === chartType || 15 === chartType || 16 === chartType || 17 === chartType;
            }
            ComboChart.enumerateDataPoints = enumerateDataPoints, ComboChart.isComboChart = isComboChart;
        }(ComboChart = visuals.ComboChart || (visuals.ComboChart = {}));
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var DataDotChart = function() {
            function DataDotChart(options) {
                this.isScrollable = options.isScrollable, this.interactivityService = options.interactivityService;
            }
            return DataDotChart.prototype.init = function(options) {
                this.options = options, this.svg = options.svg, this.svg.classed(DataDotChart.ClassName, !0), 
                this.mainGraphicsG = this.svg.append("g").classed("dataDotChartMainGraphicsContext", !0), 
                this.mainGraphicsContext = this.mainGraphicsG.append("svg"), this.currentViewport = options.viewport, 
                this.hostService = options.host, this.cartesianVisualHost = options.cartesianHost, 
                this.style = options.style, this.colors = this.style.colorPalette.dataColors, this.interactivity = options.interactivity, 
                this.element = options.element;
            }, DataDotChart.prototype.setData = function(dataViews) {
                if (this.data = {
                    series: {
                        data: []
                    },
                    hasHighlights: !1,
                    hasDynamicSeries: !1
                }, dataViews.length > 0) {
                    var dataView = dataViews[0];
                    if (dataView && dataView.categorical) {
                        var dataViewCategorical = this.dataViewCategorical = dataView.categorical, dvCategories = dataViewCategorical.categories, categoryType = powerbi.ValueType.fromDescriptor({
                            text: !0
                        });
                        dvCategories && dvCategories.length > 0 && dvCategories[0].source && dvCategories[0].source.type && (categoryType = dvCategories[0].source.type), 
                        this.data = DataDotChart.converter(dataView, visuals.valueFormatter.format(null), this.interactivityService);
                    }
                }
            }, DataDotChart.prototype.setFilteredData = function(startIndex, endIndex) {
                var data = this.clippedData = powerbi.Prototype.inherit(this.data);
                return data && data.series && data.series.data && (data.series = {
                    data: data.series.data.slice(startIndex, endIndex),
                    xCol: data.series.xCol,
                    yCol: data.series.yCol
                }), data;
            }, DataDotChart.prototype.calculateAxesProperties = function(options) {
                var _this = this;
                this.currentViewport = options.viewport, this.margin = options.margin;
                var data = this.clippedData = this.data, viewport = this.currentViewport, margin = this.margin, series = data ? data.series : null, seriesArray = series && series.data && series.data.length > 0 ? [ series ] : [], categoryCount = series && series.data ? series.data.length : 0;
                data.hasHighlights && (categoryCount /= 2);
                var xMetaDataColumn, yMetaDataColumn, width = viewport.width - (margin.left + margin.right), height = viewport.height - (margin.top + margin.bottom);
                DataDotChart.hasDataPoint(series) && (xMetaDataColumn = series.xCol, yMetaDataColumn = series.yCol);
                var layout = visuals.CartesianChart.getLayout(null, {
                    availableWidth: width,
                    categoryCount: categoryCount,
                    domain: null,
                    isScalar: !1,
                    isScrollable: this.isScrollable,
                    trimOrdinalDataOnOverflow: options.trimOrdinalDataOnOverflow,
                    outerPaddingRatio: options.outerPaddingRatio,
                    innerPaddingRatio: options.innerPaddingRatio
                }), outerPadding = layout.categoryThickness * layout.outerPaddingRatio;
                this.isScrollable || (this.clippedData = DataDotChart.createClippedDataIfOverflowed(data, layout.categoryCount));
                var yDomain = visuals.AxisHelper.createValueDomain(seriesArray, !0), combinedDomain = visuals.AxisHelper.combineDomain(options.forcedYDomain, yDomain, options.ensureYDomain);
                this.yAxisProperties = visuals.AxisHelper.createAxis({
                    pixelSpan: height,
                    dataDomain: combinedDomain,
                    metaDataColumn: yMetaDataColumn,
                    formatString: visuals.valueFormatter.getFormatString(yMetaDataColumn, DataDotChart.formatStringProp),
                    outerPadding: 0,
                    isScalar: !0,
                    isVertical: !0,
                    forcedTickCount: options.forcedTickCount,
                    useTickIntervalForDisplayUnits: !0,
                    isCategoryAxis: !1,
                    margin: margin,
                    preventNice: options.preventNiceY
                });
                var axisType = this.xAxisProperties ? this.xAxisProperties.axisType : powerbi.ValueType.fromDescriptor({
                    text: !0
                }), xDomain = visuals.AxisHelper.createDomain(seriesArray, axisType, !1, options.forcedXDomain, options.ensureXDomain);
                return this.xAxisProperties = visuals.AxisHelper.createAxis({
                    pixelSpan: width,
                    dataDomain: xDomain,
                    metaDataColumn: xMetaDataColumn,
                    formatString: visuals.valueFormatter.getFormatString(xMetaDataColumn, DataDotChart.formatStringProp),
                    outerPadding: outerPadding,
                    isScalar: !1,
                    isVertical: !1,
                    forcedTickCount: options.forcedTickCount,
                    useTickIntervalForDisplayUnits: !0,
                    categoryThickness: layout.categoryThickness,
                    getValueFn: function(index, type) {
                        return _this.lookupXValue(index, type);
                    },
                    isCategoryAxis: !0,
                    margin: margin,
                    preventNice: options.preventNiceX,
                    innerPaddingRatio: options.innerPaddingRatio
                }), [ this.xAxisProperties, this.yAxisProperties ];
            }, DataDotChart.createClippedDataIfOverflowed = function(data, categoryCount) {
                var requiredLength = data.hasHighlights ? Math.min(data.series.data.length, 2 * categoryCount) : Math.min(data.series.data.length, categoryCount);
                if (requiredLength >= data.series.data.length) return data;
                var clipped = powerbi.Prototype.inherit(data);
                return clipped.series = powerbi.Prototype.inherit(data.series), clipped.series.data = clipped.series.data.slice(0, requiredLength), 
                clipped;
            }, DataDotChart.hasDataPoint = function(series) {
                return series && series.data && series.data.length > 0;
            }, DataDotChart.prototype.lookupXValue = function(index, type) {
                var data = this.data, isDateTime = visuals.AxisHelper.isDateTime(type);
                if (isDateTime) return new Date(index);
                if (data && data.series) {
                    var seriesData = data.series.data;
                    if (seriesData) {
                        var dataAtIndex = seriesData[index];
                        if (dataAtIndex) return dataAtIndex.categoryValue;
                    }
                }
                return index;
            }, DataDotChart.prototype.overrideXScale = function(xProperties) {
                this.xAxisProperties = xProperties;
            }, DataDotChart.prototype.render = function(suppressAnimations) {
                var _this = this;
                if (this.clippedData) {
                    var data = this.clippedData, dataPoints = data.series.data, hasHighlights = data.hasHighlights, margin = this.margin, viewport = this.currentViewport, width = viewport.width - (margin.left + margin.right), height = viewport.height - (margin.top + margin.bottom), xScale = this.xAxisProperties.scale, yScale = this.yAxisProperties.scale, dotWidth = this.xAxisProperties.categoryThickness * (1 - this.xAxisProperties.innerPaddingRatio), dotRadius = dotWidth / 2, dotColor = this.style.colorPalette.dataColors.getNewColorScale().getColor(DataDotChart.DotColorKey), hasSelection = !!this.interactivityService && this.interactivityService.hasSelection();
                    this.mainGraphicsContext.attr("width", width).attr("height", height);
                    var dots = this.mainGraphicsContext.selectAll(DataDotChart.DotClassSelector).data(dataPoints, function(d) {
                        return d.identity.getKey();
                    });
                    dots.enter().append("circle").classed(DataDotChart.DotClassName, !0), dots.style({
                        fill: dotColor.value
                    }).style("fill-opacity", function(d) {
                        return visuals.ColumnUtil.getFillOpacity(d.selected, d.highlight, hasSelection, hasHighlights);
                    }).classed("null-value", function(d) {
                        return null === d.value;
                    }).attr({
                        r: function(d) {
                            return dotRadius;
                        },
                        cx: function(d) {
                            return xScale(d.categoryIndex) + dotRadius;
                        },
                        cy: function(d) {
                            return yScale(d.value);
                        }
                    }), dots.exit().remove();
                    var dotLabels = this.mainGraphicsContext.selectAll(DataDotChart.DotLabelClassSelector).data(dataPoints, function(d) {
                        return d.identity.getKey();
                    });
                    dotLabels.enter().append("text").classed(DataDotChart.DotLabelClassName, !0).attr({
                        "text-anchor": DataDotChart.DotLabelTextAnchor,
                        dy: DataDotChart.DotLabelVerticalOffset
                    }), dotLabels.classed("null-value", function(d) {
                        return null === d.value;
                    }).classed("overflowed", !1).attr({
                        x: function(d) {
                            return xScale(d.categoryIndex) + dotRadius;
                        },
                        y: function(d) {
                            return yScale(d.value);
                        }
                    }).text(function(d) {
                        return _this.yAxisProperties.formatter.format(d.value);
                    });
                    var overflowed = !1;
                    dotLabels.each(function() {
                        if (!overflowed && !$("<div>").addClass($(this).attr("class")).hasClass("null-value")) {
                            var width_1 = powerbi.TextMeasurementService.measureSvgTextElementWidth(this);
                            width_1 > dotWidth && (dotLabels.classed("overflowed", !0), overflowed = !0);
                        }
                    }), dotLabels.exit().remove();
                    var behaviorOptions;
                    return this.interactivityService && (behaviorOptions = {
                        dots: dots,
                        dotLabels: dotLabels,
                        datapoints: dataPoints
                    }), visuals.SVGUtil.flushAllD3TransitionsIfNeeded(this.options), {
                        dataPoints: dataPoints,
                        behaviorOptions: behaviorOptions,
                        labelDataPoints: [],
                        labelsAreNumeric: !0,
                        animateLabels: !1
                    };
                }
            }, DataDotChart.prototype.calculateLegend = function() {
                return this.createLegendDataPoints(0);
            }, DataDotChart.prototype.hasLegend = function() {
                return this.data && this.data.hasDynamicSeries;
            }, DataDotChart.prototype.createLegendDataPoints = function(columnIndex) {
                var data = this.data;
                if (!data) return null;
                var category, series = data.series, seriesData = series.data, legendData = visuals.Legend.getDefaultLegendData(), legendDataPoints = [], axisType = this.xAxisProperties ? this.xAxisProperties.axisType : powerbi.ValueType.fromDescriptor({
                    text: !0
                });
                if (data.series && data.series.data) {
                    var firstDataPoint = data.series.data[0];
                    category = firstDataPoint && this.lookupXValue(firstDataPoint.categoryValue, axisType);
                }
                if (series.yCol) {
                    var formatStringProp = DataDotChart.formatStringProp, lineDataPoint = seriesData[columnIndex], measure = lineDataPoint && lineDataPoint.value, label = visuals.converterHelper.getFormattedLegendLabel(series.yCol, this.dataViewCategorical.values, formatStringProp), dotColor = this.style.colorPalette.dataColors.getNewColorScale().getColor(DataDotChart.DotColorKey), dataViewCategoricalValues = this.dataViewCategorical.values, identity = dataViewCategoricalValues && dataViewCategoricalValues.length > columnIndex ? visuals.SelectionId.createWithIdAndMeasure(dataViewCategoricalValues[columnIndex].identity, dataViewCategoricalValues[columnIndex].source.queryName) : visuals.SelectionId.createWithMeasure(dataViewCategoricalValues.source.queryName);
                    legendDataPoints.push({
                        color: dotColor.value,
                        icon: visuals.LegendIcon.Line,
                        label: label,
                        category: visuals.valueFormatter.format(category, visuals.valueFormatter.getFormatString(series.xCol, formatStringProp)),
                        measure: visuals.valueFormatter.format(measure, visuals.valueFormatter.getFormatString(series.yCol, formatStringProp)),
                        identity: identity,
                        selected: !1
                    });
                }
                return legendData.dataPoints = legendDataPoints, legendData;
            }, DataDotChart.prototype.onClearSelection = function() {
                this.interactivityService && this.interactivityService.clearSelection();
            }, DataDotChart.converter = function(dataView, blankCategoryValue, interactivityService) {
                var categorical = dataView.categorical, category = categorical.categories && categorical.categories.length > 0 ? categorical.categories[0] : {
                    source: void 0,
                    values: [ blankCategoryValue ],
                    identity: void 0
                }, categoryType = visuals.AxisHelper.getCategoryValueType(category.source), isDateTime = visuals.AxisHelper.isDateTime(categoryType), categoryValues = category.values;
                if (!_.isEmpty(categorical.values)) {
                    for (var measure = categorical.values[0], hasHighlights = !!measure.highlights, dataPoints = [], categoryIndex = 0, len = measure.values.length; categoryIndex < len; categoryIndex++) {
                        var idBuilder = new visuals.SelectionIdBuilder();
                        category.identity && (idBuilder = idBuilder.withCategory(category, categoryIndex));
                        var identity = idBuilder.withMeasure(measure.source.queryName).createSelectionId(), categoryValue = categoryValues[categoryIndex];
                        if ((!isDateTime || null == categoryValue || categoryValue instanceof Date) && (dataPoints.push({
                            categoryValue: isDateTime && categoryValue ? categoryValue.getTime() : categoryValue,
                            value: measure.values[categoryIndex],
                            categoryIndex: categoryIndex,
                            seriesIndex: 0,
                            selected: !1,
                            identity: identity,
                            highlight: !1
                        }), hasHighlights)) {
                            var highlightIdentity = visuals.SelectionId.createWithHighlight(identity), highlightValue = measure.highlights[categoryIndex];
                            dataPoints.push({
                                categoryValue: isDateTime && categoryValue ? categoryValue.getTime() : categoryValue,
                                value: highlightValue,
                                categoryIndex: categoryIndex,
                                seriesIndex: 0,
                                selected: !1,
                                identity: highlightIdentity,
                                highlight: !0
                            });
                        }
                    }
                    return interactivityService && interactivityService.applySelectionStateToData(dataPoints), 
                    {
                        series: {
                            xCol: category.source,
                            yCol: measure.source,
                            data: dataPoints
                        },
                        hasHighlights: hasHighlights,
                        hasDynamicSeries: !0
                    };
                }
                return {
                    series: {
                        data: []
                    },
                    hasHighlights: !1,
                    hasDynamicSeries: !1
                };
            }, DataDotChart.prototype.getCartesianVisualCapabilities = function() {
                return {
                    supportsHierarchicalCategoryAxis: !1
                };
            }, DataDotChart.prototype.getStaticSeriesRole = function() {}, DataDotChart.formatStringProp = {
                objectName: "general",
                propertyName: "formatString"
            }, DataDotChart.ClassName = "dataDotChart", DataDotChart.DotClassName = "dot", DataDotChart.DotClassSelector = ".dot", 
            DataDotChart.DotColorKey = "dataDot", DataDotChart.DotLabelClassName = "label", 
            DataDotChart.DotLabelClassSelector = ".label", DataDotChart.DotLabelVerticalOffset = "0.4em", 
            DataDotChart.DotLabelTextAnchor = "middle", DataDotChart;
        }();
        visuals.DataDotChart = DataDotChart;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var DataDotChartWebBehavior = function() {
            function DataDotChartWebBehavior() {}
            return DataDotChartWebBehavior.prototype.bindEvents = function(options, selectionHandler) {
                var dots = this.dots = options.dots, dotLabels = options.dotLabels;
                visuals.InteractivityUtils.registerStandardInteractivityHandlers(dots, selectionHandler), 
                dotLabels && visuals.InteractivityUtils.registerStandardInteractivityHandlers(dotLabels, selectionHandler);
            }, DataDotChartWebBehavior.prototype.renderSelection = function(hasSelection) {
                this.dots.style("fill-opacity", function(d) {
                    return visuals.ColumnUtil.getFillOpacity(d.selected, d.highlight, hasSelection, !1);
                });
            }, DataDotChartWebBehavior;
        }();
        visuals.DataDotChartWebBehavior = DataDotChartWebBehavior;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var EnumExtensions = jsCommon.EnumExtensions, createClassAndSelector = jsCommon.CssConstants.createClassAndSelector, LineChart = function() {
            function LineChart(options) {
                var _this = this;
                this.pathXAdjustment = 0, this.deferDragMoveOperation = jsCommon.DeferUtility.deferUntilNextFrame(function() {
                    if (_this.lastDragMoveXPosition && _this.data && _this.margin) {
                        var index = _this.findCategoryIndex(_this.lastDragMoveXPosition - _this.margin.left, 0, _this.data.categoryData);
                        _this.selectColumn(index), _this.lastDragMoveXPosition = void 0;
                    }
                }), this.isScrollable = !!options.isScrollable && options.isScrollable, this.tooltipsEnabled = options.tooltipsEnabled, 
                this.lineType = options.chartType ? options.chartType : 1, this.interactivityService = options.interactivityService, 
                this.animator = options.animator, this.lineClassAndSelector = LineChart.LineClassSelector, 
                this.axisControlImprovements = options.featureSwitches.axisControlImprovements, 
                this.binnedLineSamplingSupported = options.featureSwitches.binnedLineSamplingSupported, 
                this.customFontFamilyForDataLabel = options.featureSwitches.customFontFamilyForDataLabel, 
                this.lineMarkersEnabled = options.featureSwitches.lineMarkersEnabled, this.lineStylesEnabled = options.featureSwitches.lineStylesEnabled;
            }
            return LineChart.convertCategoryValue = function(value, isDateTime, useScalarKeys) {
                return (isDateTime || useScalarKeys) && value ? value.getTime() : value;
            }, LineChart.getDefaultLineChartLabelSettings = function() {
                return {
                    show: !1,
                    position: 0,
                    displayUnits: 0,
                    precision: visuals.dataLabelUtils.defaultLabelPrecision,
                    fontProperties: visuals.FontProperties.inherit(visuals.LabelUtils.defaultFontProperties, {
                        color: visuals.LabelUtils.defaultLabelColor
                    }),
                    labelDensity: visuals.LabelUtils.defaultLabelDensity
                };
            }, LineChart.converter = function(options) {
                var dataView = options.dataView, style = options.style, interactivityService = options.interactivityService, shouldCalculateStacked = options.shouldCalculateStacked, isComboChart = options.isComboChart, forecastDataView = options.forecastDataView, tooltipsEnabled = options.tooltipsEnabled;
                null == tooltipsEnabled && (tooltipsEnabled = !0);
                var scalarMetadataColumn, xAxisCardProperties = visuals.CartesianHelper.getCategoryAxisProperties(dataView.metadata), isScalar = visuals.CartesianHelper.isScalar(options.isScalar, xAxisCardProperties), valueRoleName = options.isComboChart ? "Y2" : "Y", categorical = dataView.categorical, colors = style.colorPalette.dataColors, reader = powerbi.data.createDataViewCategoricalReaderAdvanced(dataView, {
                    staticSeriesRole: valueRoleName,
                    colorOptions: {
                        visualStyle: style,
                        valueRole: valueRoleName,
                        ignoreDefaultColor: options.isComboChart,
                        ignoreDefaultCategoryColor: !0
                    }
                }), dataReader = reader.data, columnReader = reader.columns, scalarKeyInfo = visuals.CartesianHelper.getScalarKeyinfo(categorical, isScalar), category = scalarKeyInfo.category, useScalarKeys = scalarKeyInfo.useScalarKeys, scalarKeys = scalarKeyInfo.scalarKeys;
                useScalarKeys && (scalarMetadataColumn = {
                    displayName: null,
                    type: {
                        dateTime: !0
                    }
                });
                var objects, formatStringProp = visuals.lineChartProps.general.formatString, categoryType = visuals.AxisHelper.getCategoryValueType(category.source, isScalar), isDateTime = visuals.AxisHelper.isDateTime(categoryType), categoryValues = category.values, categoryData = [], categoryIdentities = [], series = [], categoryCount = dataReader.hasCategories() ? dataReader.getCategoryCount() : 1, seriesCount = dataReader.getSeriesCount(), values = categorical.values, hasDynamicSeries = !(!values || !values.source), defaultLabelSettings = LineChart.getDefaultLineChartLabelSettings(), staticObjects = reader.objects.getStaticObjects();
                if (dataView.metadata && dataView.metadata.objects) {
                    objects = dataView.metadata.objects;
                    var labelsObj = objects.labels;
                    visuals.LabelUtils.updateLabelSettingsFromLabelsObjectWithLabelDensity(labelsObj, defaultLabelSettings);
                }
                var grouped;
                values && (grouped = values.grouped());
                var stackedValues;
                shouldCalculateStacked && (stackedValues = values && values.length > 0 ? _.times(values[0].values.length, function() {
                    return 0;
                }) : []);
                var readMarkerOptions = !isScalar && powerbi.DataViewObjects.getValue(objects, visuals.lineChartProps.lineStyles.showMarker, !1), staticLineStyle = visuals.LineStyle.readFromStaticObjects(staticObjects, readMarkerOptions);
                if (dataReader.hasValues(valueRoleName)) for (var seriesIndex = 0; seriesIndex < seriesCount; seriesIndex++) {
                    var column = columnReader.getValueColumn(valueRoleName, seriesIndex), valuesMetadata = column.source, dataPoints = [], identity = visuals.SelectionIdBuilder.builder().withSeries(values, column).withMeasure(columnReader.getValueMetadataColumn(valueRoleName, seriesIndex).queryName).createSelectionId(), key = identity.getKey(), color = reader.colors.createBySeries(seriesIndex), seriesLabelSettings = void 0;
                    if (!hasDynamicSeries) {
                        var labelsSeriesGroup = grouped && grouped.length > 0 && grouped[0].values ? grouped[0].values[seriesIndex] : null, labelObjects = labelsSeriesGroup && labelsSeriesGroup.source && labelsSeriesGroup.source.objects ? labelsSeriesGroup.source.objects.labels : null;
                        labelObjects && (seriesLabelSettings = powerbi.Prototype.inherit(defaultLabelSettings), 
                        visuals.LabelUtils.updateLabelSettingsFromLabelsObjectWithLabelDensity(labelObjects, seriesLabelSettings));
                    }
                    for (var dataPointLabelSettings = seriesLabelSettings ? seriesLabelSettings : defaultLabelSettings, useHighlightValues = column.highlights && column.highlights.length > 0, showAllSeries = powerbi.DataViewObjects.getValue(objects, visuals.lineChartProps.lineStyles.showSeries, !1), readSeriesMarkerOptions = !isScalar && showAllSeries, lineStyle_1 = visuals.LineStyle.readFromSeriesObjects(reader, staticLineStyle, seriesIndex, readSeriesMarkerOptions, showAllSeries), dataPointsIndex = -1, categoryIndex = 0; categoryIndex < categoryCount; categoryIndex++) {
                        var categoryValue = categoryValues[categoryIndex], xAxisValue = useScalarKeys ? scalarKeys.values[categoryIndex].min : categoryValue, value = visuals.AxisHelper.normalizeNonFiniteNumber(useHighlightValues ? dataReader.getHighlight(valueRoleName, categoryIndex, seriesIndex) : dataReader.getValue(valueRoleName, categoryIndex, seriesIndex));
                        if (!(isScalar && (null == xAxisValue || null == value) || isDateTime && null != categoryValue && !(categoryValue instanceof Date) || (dataPointsIndex++, 
                        null == value && seriesIndex > 0))) {
                            var tooltipInfo = void 0, additionalTooltipItems = void 0, categoryLevels = void 0;
                            if (tooltipsEnabled) {
                                if (tooltipInfo = [], category.source) {
                                    categoryLevels = visuals.CategoryLevelUtils.getCategoryLevels(dataView.categorical.categories, categoryIndex, formatStringProp);
                                    var concatenatedCategoryLevel = visuals.CategoryLevelUtils.concatenateCategoryLevels(categoryLevels);
                                    tooltipInfo.push({
                                        displayName: concatenatedCategoryLevel.displayName,
                                        value: concatenatedCategoryLevel.value
                                    });
                                }
                                hasDynamicSeries && (category.source && category.source === values.source || tooltipInfo.push({
                                    displayName: values.source.displayName,
                                    value: visuals.converterHelper.formatFromMetadataColumn(grouped[seriesIndex].name, values.source, formatStringProp)
                                })), null != value && tooltipInfo.push({
                                    displayName: valuesMetadata.displayName,
                                    value: visuals.converterHelper.formatFromMetadataColumn(value, valuesMetadata, formatStringProp, !1)
                                }), additionalTooltipItems = [], visuals.TooltipBuilder.addTooltipMeasures(reader, additionalTooltipItems, categoryIndex, hasDynamicSeries ? seriesIndex : void 0, formatStringProp), 
                                additionalTooltipItems = _.isEmpty(additionalTooltipItems) ? void 0 : additionalTooltipItems;
                            }
                            var idBuilder = new visuals.SelectionIdBuilder();
                            dataReader.hasCategories() && (idBuilder = idBuilder.withCategory(columnReader.getCategoryColumn("Category"), categoryIndex)), 
                            hasDynamicSeries && (idBuilder = idBuilder.withSeries(values, columnReader.getValueColumn(valueRoleName, seriesIndex)));
                            var specificIdentity = idBuilder.withMeasure(columnReader.getValueMetadataColumn(valueRoleName, seriesIndex).queryName).createSelectionId(), categoryKey = category && !_.isEmpty(category.identity) && category.identity[categoryIndex] ? category.identity[categoryIndex].key : categoryIndex, dataPoint = {
                                categoryValue: LineChart.convertCategoryValue(xAxisValue, isDateTime, useScalarKeys),
                                value: value,
                                categoryIndex: categoryIndex,
                                seriesIndex: seriesIndex,
                                tooltipInfo: tooltipInfo,
                                selected: !1,
                                identity: identity,
                                specificIdentity: specificIdentity,
                                key: JSON.stringify({
                                    series: key,
                                    category: categoryKey
                                }),
                                labelFill: dataPointLabelSettings.fontProperties.color,
                                labelFormatString: valuesMetadata.format,
                                labelSettings: dataPointLabelSettings,
                                additionalTooltipItems: additionalTooltipItems,
                                hierarchyCategoryLevels: categoryLevels,
                                lineStyle: lineStyle_1
                            };
                            if (shouldCalculateStacked && (stackedValues[categoryIndex] += value, dataPoint.stackedValue = stackedValues[categoryIndex]), 
                            category.objects && category.objects[categoryIndex] && (dataPoint.pointColor = powerbi.DataViewObjects.getFillColor(category.objects[categoryIndex], visuals.lineChartProps.dataPoint.fill)), 
                            dataPoints[dataPointsIndex] = dataPoint, categoryData[categoryIndex] || (categoryData[categoryIndex] = dataPoint), 
                            !categoryIdentities[categoryIndex] && dataReader.hasCategories()) {
                                var categoryIdBuilder = new visuals.SelectionIdBuilder();
                                categoryIdentities[categoryIndex] = categoryIdBuilder.withCategory(columnReader.getCategoryColumn("Category"), categoryIndex).withMeasure(columnReader.getValueMetadataColumn(valueRoleName, seriesIndex).queryName).createSelectionId();
                            }
                        }
                    }
                    interactivityService && interactivityService.applySelectionStateToData(_.filter(dataPoints, function(dataPoint) {
                        return null != dataPoint;
                    }));
                    var seriesName = void 0;
                    seriesName = reader.columns.hasDynamicSeries() ? visuals.valueFormatter.format(reader.data.getSeriesName(seriesIndex), reader.objects.getSeriesFormatString(seriesIndex)) : reader.columns.hasStaticSeries() ? reader.data.getSeriesName(seriesIndex) : reader.data.getValueDisplayName(valueRoleName), 
                    dataPoints.length > 0 && series.push({
                        seriesName: seriesName,
                        key: key,
                        lineIndex: seriesIndex,
                        color: color,
                        xCol: useScalarKeys ? scalarMetadataColumn : category.source,
                        yCol: columnReader.getValueMetadataColumn(valueRoleName, seriesIndex),
                        data: dataPoints,
                        identity: identity,
                        selected: !1,
                        labelSettings: seriesLabelSettings,
                        type: valuesMetadata.type,
                        lineStyle: lineStyle_1
                    });
                }
                var forecastLines;
                if (forecastDataView && isScalar && !shouldCalculateStacked && !isComboChart) {
                    forecastLines = visuals.ForecastHelper.readDataView(forecastDataView, dataView, colors);
                    for (var lastDataPoint = _.last(categoryData), _i = 0, forecastLines_1 = forecastLines; _i < forecastLines_1.length; _i++) for (var forecastLine = forecastLines_1[_i], categoryIndex = lastDataPoint.categoryIndex, _a = 0, _b = forecastLine.points; _a < _b.length; _a++) {
                        var point = _b[_a];
                        point.point.x = LineChart.convertCategoryValue(point.point.x, isDateTime, useScalarKeys), 
                        point.upperBound.x = LineChart.convertCategoryValue(point.upperBound.x, isDateTime, useScalarKeys), 
                        point.lowerBound.x = LineChart.convertCategoryValue(point.lowerBound.x, isDateTime, useScalarKeys);
                        var x = point.point.x;
                        x <= lastDataPoint.categoryValue || (categoryIndex++, categoryData[categoryIndex] || (categoryData[categoryIndex] = {
                            categoryIndex: categoryIndex,
                            categoryValue: x,
                            value: point.point.y,
                            seriesIndex: 0
                        }), categoryIdentities[categoryIndex] || (categoryIdentities[categoryIndex] = null));
                    }
                }
                var binnedLineSamplingApplied = !1, reductionMetadata = dataView.metadata && dataView.metadata.dataReduction;
                reductionMetadata && reductionMetadata.categorical && (reductionMetadata.categorical.metadata && reductionMetadata.categorical.metadata.binnedLineSample || reductionMetadata.categorical.categories && reductionMetadata.categorical.categories.binnedLineSample || reductionMetadata.categorical.values && reductionMetadata.categorical.values.binnedLineSample) && (binnedLineSamplingApplied = !0), 
                xAxisCardProperties = visuals.CartesianHelper.getCategoryAxisProperties(dataView.metadata);
                var preferredCategoryWidth = visuals.CartesianHelper.getPreferredCategoryWidth(xAxisCardProperties), valuesMetadataArray = columnReader.getAllValueMetadataColumnsForRole(valueRoleName);
                return interactivityService && interactivityService.applySelectionStateToData(series), 
                {
                    series: series,
                    forecastLines: forecastLines,
                    isScalar: isScalar,
                    dataLabelsSettings: defaultLabelSettings,
                    hasDynamicSeries: hasDynamicSeries,
                    categoryMetadata: category.source,
                    valuesMetadata: valuesMetadataArray,
                    preferredCategoryWidth: preferredCategoryWidth,
                    scalarMetadata: scalarMetadataColumn,
                    scalarKeyCount: useScalarKeys ? scalarKeys.values.length : void 0,
                    categories: categoryValues,
                    categoryData: categoryData,
                    seriesDisplayName: hasDynamicSeries && dataReader.hasValues(valueRoleName) ? visuals.converterHelper.formatFromMetadataColumn(dataReader.getSeriesDisplayName(), columnReader.getSeriesMetadataColumn(), formatStringProp) : void 0,
                    hasValues: dataReader.hasValues(valueRoleName),
                    categoryIdentities: categoryIdentities,
                    lineStyle: staticLineStyle,
                    binnedLineSamplingApplied: binnedLineSamplingApplied,
                    legendMarkerRendering: powerbi.DataViewObjects.getValue(staticObjects, visuals.lineChartProps.legend.legendMarkerRendering, visuals.legendMarkerRendering.markerOnly),
                    matchLineColor: powerbi.DataViewObjects.getValue(staticObjects, visuals.lineChartProps.legend.matchLineColor, !0),
                    defaultToCircle: powerbi.DataViewObjects.getValue(staticObjects, visuals.lineChartProps.legend.defaultToCircle, !0)
                };
            }, LineChart.getInteractiveLineChartDomElement = function(element) {
                return element.children("svg").get(0);
            }, LineChart.createStackedValueDomain = function(data) {
                if (0 === data.length) return null;
                var minY = d3.min(data, function(kv) {
                    return d3.min(kv.data, function(d) {
                        return d && d.stackedValue;
                    });
                }), maxY = d3.max(data, function(kv) {
                    return d3.max(kv.data, function(d) {
                        return d && d.stackedValue;
                    });
                });
                return [ minY, maxY ];
            }, LineChart.prototype.init = function(options) {
                var _this = this;
                this.options = options, this.element = options.element, this.cartesainSVG = options.svg, 
                this.host = options.host, this.currentViewport = options.viewport, this.style = options.style, 
                this.isInteractiveChart = options.interactivity && options.interactivity.isInteractiveLegend, 
                this.cartesianVisualHost = options.cartesianHost, this.scaleDetector = new visuals.SVGScaleDetector(this.cartesainSVG);
                var chartType = options.chartType;
                this.isComboChart = 11 === chartType || 14 === chartType || 15 === chartType;
                var svg = options.svg;
                svg.classed(LineChart.ClassName, !0);
                var graphicsContextParent = this.mainGraphicsSVG = svg.append("svg").classed("lineChartSVG", !0);
                this.svgDefs = graphicsContextParent.append("defs");
                var supportsHoverLineTooltip = !this.isComboChart && !this.isInteractiveChart;
                this.tooltipService = new LineChartTooltipService(options.services.tooltips, graphicsContextParent, supportsHoverLineTooltip), 
                this.mainGraphicsContext = graphicsContextParent.append("g").classed(LineChart.MainGraphicsContextClassName, !0), 
                this.hoverLineContext = svg.append("g").classed("hover-line", !0), this.hoverLineContext.append(LineChart.LineElementName).attr("x1", 0).attr("x2", 0).attr("y1", 0).attr("y2", 0);
                var hoverLine = this.hoverLine = this.hoverLineContext.select(LineChart.LineElementName);
                if (this.isInteractiveChart && hoverLine.classed("interactive", !0), hoverLine.style("opacity", visuals.SVGUtil.AlmostZero), 
                this.selectionCircles = [], this.xAxisProperties = {
                    axis: null,
                    scale: null,
                    axisType: null,
                    formatter: null,
                    graphicsContext: null,
                    values: null,
                    axisLabel: null,
                    isCategoryAxis: !0
                }, this.isInteractiveChart) {
                    var rootSvg_1 = LineChart.getInteractiveLineChartDomElement(this.element), dragMove = function() {
                        _this.lastDragMoveXPosition = d3.mouse(rootSvg_1)[0], _this.deferDragMoveOperation();
                    }, drag = d3.behavior.drag().origin(Object).on("drag", dragMove);
                    d3.select(rootSvg_1).style("touch-action", "none").call(drag).on("click", dragMove);
                }
                jsCommon.BrowserUtils.isInternetExplorerOrEdge() ? this.pathXAdjustment = 5 : jsCommon.BrowserUtils.isFirefox() && (this.pathXAdjustment = 2 * LineChart.interactivityStrokeWidth), 
                this.markerRenderer = new visuals.MarkerRenderer();
            }, LineChart.prototype.setData = function(dataViews) {
                if (this.data = {
                    series: [],
                    dataLabelsSettings: LineChart.getDefaultLineChartLabelSettings(),
                    hasDynamicSeries: !1,
                    categories: [],
                    categoryMetadata: void 0,
                    valuesMetadata: [],
                    categoryData: [],
                    categoryIdentities: [],
                    lineStyle: visuals.LineStyle.getDefault(),
                    binnedLineSamplingApplied: !1,
                    legendMarkerRendering: visuals.legendMarkerRendering.markerOnly,
                    matchLineColor: !1,
                    defaultToCircle: !0
                }, dataViews.length > 0) {
                    var dataView = dataViews[0], forecastDataView = _.find(dataViews, function(dataView) {
                        return visuals.ForecastHelper.isDataViewForForecast(dataView);
                    });
                    if (dataView && dataView.categorical) {
                        this.dataView = dataView;
                        var dataViewCat = dataView.categorical, dvCategories = dataViewCat.categories, categoryType = {
                            text: !0
                        }, scalarKeys = void 0;
                        dvCategories && !_.isEmpty(dvCategories) && (dvCategories[0].source && dvCategories[0].source.type && (categoryType = dvCategories[0].source.type), 
                        scalarKeys = visuals.ScalarUtils.getScalarKeys(dvCategories[0]));
                        var hasHierarchy = visuals.CartesianHelper.hasCategoryHierarchy(dataView), isScalar = visuals.ScalarUtils.shouldDrawScalar(dataView.metadata ? dataView.metadata.objects : null, visuals.lineChartProps.categoryAxis.axisType, categoryType, scalarKeys, hasHierarchy), convertedData = LineChart.converter({
                            dataView: dataView,
                            style: this.style,
                            isScalar: isScalar,
                            interactivityService: this.interactivityService,
                            isComboChart: this.isComboChart,
                            tooltipsEnabled: this.tooltipsEnabled,
                            forecastDataView: forecastDataView,
                            shouldCalculateStacked: EnumExtensions.hasFlag(this.lineType, 16)
                        });
                        this.data = convertedData;
                        var previousCategoryIds = this.previousCategoryIds, currentCategoryIds = convertedData.categoryIdentities;
                        this.suppressAnimation = LineChart.shouldSuppressAnimations(previousCategoryIds, currentCategoryIds), 
                        this.previousCategoryIds = currentCategoryIds;
                    }
                } else this.dataView = void 0;
            }, LineChart.shouldSuppressAnimations = function(previousCategoryIds, currentCategoryIds) {
                var suppressAnimation;
                if (null != previousCategoryIds && !(previousCategoryIds.length > visuals.AnimatorCommon.MaxDataPointsToAnimate || currentCategoryIds.length > visuals.AnimatorCommon.MaxDataPointsToAnimate)) if (suppressAnimation = !1, 
                0 === previousCategoryIds.length) suppressAnimation = !0; else for (var categoryIndex = 0, categoryCount = Math.min(previousCategoryIds.length, currentCategoryIds.length); categoryIndex < categoryCount; categoryIndex++) if (!visuals.SelectionId.isEqual(previousCategoryIds[categoryIndex], currentCategoryIds[categoryIndex])) {
                    suppressAnimation = !0;
                    break;
                }
                return suppressAnimation;
            }, LineChart.prototype.getValueDomain = function(options, includeZero) {
                var data = this.data, extendedYDomain = this.ensureDomainsIncludeForecast(data.forecastLines, options.ensureXDomain, options.ensureYDomain).y, valueDomain = EnumExtensions.hasFlag(this.lineType, 16) ? LineChart.createStackedValueDomain(data.series) : visuals.AxisHelper.createValueDomain(data.series, includeZero), combinedDomain = visuals.AxisHelper.combineDomain(options.forcedYDomain, valueDomain, extendedYDomain);
                return combinedDomain;
            }, LineChart.prototype.calculateLegend = function() {
                return this.createLegendDataPoints(0);
            }, LineChart.prototype.hasLegend = function() {
                return this.data && (this.data.hasDynamicSeries || this.data.series && this.data.series.length > 1);
            }, LineChart.prototype.setFilteredData = function(startIndex, endIndex) {
                var catgSize = endIndex - startIndex, data = this.clippedData = powerbi.Prototype.inherit(this.data);
                return data.series = LineChart.sliceSeries(data.series, catgSize, startIndex), data.categories = data.categories.slice(startIndex, endIndex), 
                data;
            }, LineChart.prototype.ensureDomainsIncludeForecast = function(forecastLines, xDomain, yDomain) {
                if (_.isEmpty(forecastLines)) return {
                    x: xDomain,
                    y: yDomain
                };
                for (var xs = [ xDomain.min, xDomain.max ], ys = [ yDomain.min, yDomain.max ], _i = 0, forecastLines_2 = forecastLines; _i < forecastLines_2.length; _i++) {
                    var forecastLine = forecastLines_2[_i];
                    _.isEmpty(forecastLine.points) || (xs.push.apply(xs, _.map(forecastLine.points, function(p) {
                        return p.point.x;
                    })), ys.push.apply(ys, _.map(forecastLine.points, function(p) {
                        return p.point.y;
                    })), xs.push.apply(xs, _.map(forecastLine.points, function(p) {
                        return p.upperBound.x;
                    })), ys.push.apply(ys, _.map(forecastLine.points, function(p) {
                        return p.upperBound.y;
                    })), xs.push.apply(xs, _.map(forecastLine.points, function(p) {
                        return p.lowerBound.x;
                    })), ys.push.apply(ys, _.map(forecastLine.points, function(p) {
                        return p.lowerBound.y;
                    })));
                }
                var extendedXDomain = {
                    min: d3.min(xs),
                    max: d3.max(xs)
                }, extendedYDomain = {
                    min: d3.min(ys),
                    max: d3.max(ys)
                };
                return {
                    x: extendedXDomain,
                    y: extendedYDomain
                };
            }, LineChart.prototype.calculateAxesProperties = function(options) {
                var _this = this, data = this.data, viewport = options.viewport, margin = options.margin;
                this.currentViewport = viewport, this.margin = margin;
                var origCatgSize = data.series && data.series.length > 0 ? data.series[0].data.length : 0, defaultCategoryWidth = visuals.CartesianHelper.MinOrdinalRectThickness, isScalar = this.data.isScalar, trimOrdinalDataOnOverflow = options.trimOrdinalDataOnOverflow, preferredPlotArea = this.getPreferredPlotArea(isScalar, origCatgSize, defaultCategoryWidth), preferredCategoryWidth = data.preferredCategoryWidth;
                if (this.clippedData = void 0, data && !isScalar && !this.isScrollable && trimOrdinalDataOnOverflow) {
                    var categoryCount = this.getCategoryCount(origCatgSize, options.outerPaddingRatio), catgSize = Math.min(origCatgSize, categoryCount);
                    catgSize !== origCatgSize && (data = this.clippedData = powerbi.Prototype.inherit(data), 
                    this.clippedData.series = LineChart.sliceSeries(data.series, catgSize));
                }
                var xMetaDataColumn, yMetaDataColumn;
                data.series && data.series.length > 0 && (xMetaDataColumn = data.series[0].xCol, 
                yMetaDataColumn = data.series[0].yCol);
                var _a = this.ensureDomainsIncludeForecast(data.forecastLines, options.ensureXDomain, options.ensureYDomain), extendedXDomain = _a.x, extendedYDomain = _a.y, valueDomain = EnumExtensions.hasFlag(this.lineType, 16) ? LineChart.createStackedValueDomain(data.series) : visuals.AxisHelper.createValueDomain(data.series, !1), hasZeroValueInYDomain = options.valueAxisScaleType === visuals.axisScale.log && !visuals.AxisHelper.isLogScalePossible(valueDomain), combinedDomain = visuals.AxisHelper.combineDomain(options.forcedYDomain, valueDomain, extendedYDomain);
                this.yAxisProperties = visuals.AxisHelper.createAxis({
                    pixelSpan: preferredPlotArea.height,
                    dataDomain: combinedDomain,
                    zeroScalarDomain: [ -1, 1 ],
                    metaDataColumn: this.data.valuesMetadata,
                    formatString: visuals.valueFormatter.getFormatString(yMetaDataColumn, visuals.lineChartProps.general.formatString),
                    outerPadding: 0,
                    isScalar: !0,
                    isVertical: !0,
                    forcedTickCount: options.forcedTickCount,
                    useTickIntervalForDisplayUnits: !0,
                    isCategoryAxis: !1,
                    scaleType: options.valueAxisScaleType,
                    axisDisplayUnits: options.valueAxisDisplayUnits,
                    axisPrecision: options.valueAxisPrecision,
                    shouldClamp: !1,
                    outerPaddingRatio: 0,
                    margin: margin,
                    preventNice: options.preventNiceY
                });
                var metaDataColumn = data.scalarMetadata ? data.scalarMetadata : data.categoryMetadata, xAxisDataType = visuals.AxisHelper.getCategoryValueType(metaDataColumn), xDomain = visuals.AxisHelper.createDomain(data.series, xAxisDataType, this.data.isScalar, options.forcedXDomain, extendedXDomain), hasZeroValueInXDomain = options.categoryAxisScaleType === visuals.axisScale.log && !visuals.AxisHelper.isLogScalePossible(xDomain), categoryLayoutOptions = {
                    categoryCount: origCatgSize,
                    availableWidth: this.getAvailableWidth(),
                    domain: xDomain,
                    isScalar: isScalar,
                    trimOrdinalDataOnOverflow: trimOrdinalDataOnOverflow,
                    preferredCategoryWidth: preferredCategoryWidth,
                    outerPaddingRatio: options.outerPaddingRatio
                }, defaultCategoryThickness = visuals.CartesianChart.getCategoryWidth(data.series, categoryLayoutOptions), categoryThicknessInfo = visuals.CartesianChart.getCustomizedCategoryWidthInfo(defaultCategoryThickness, categoryLayoutOptions);
                return this.xAxisProperties = visuals.AxisHelper.createAxis({
                    pixelSpan: preferredPlotArea.width,
                    dataDomain: xDomain,
                    zeroScalarDomain: [ -1, 1 ],
                    metaDataColumn: xMetaDataColumn,
                    formatString: visuals.valueFormatter.getFormatString(xMetaDataColumn, visuals.lineChartProps.general.formatString),
                    outerPadding: this.data.isScalar ? LineChart.ScalarOuterPadding : 0,
                    isScalar: this.data.isScalar,
                    isVertical: !1,
                    forcedTickCount: options.forcedTickCount,
                    maxTickCount: data.scalarKeyCount,
                    useTickIntervalForDisplayUnits: !0,
                    getValueFn: function(index, type) {
                        return visuals.CartesianHelper.lookupXValue(_this.data, index, type, _this.data.isScalar);
                    },
                    categoryThickness: categoryThicknessInfo.categoryWidth,
                    isCategoryAxis: !0,
                    scaleType: options.categoryAxisScaleType,
                    axisDisplayUnits: options.categoryAxisDisplayUnits,
                    axisPrecision: options.categoryAxisPrecision,
                    outerPaddingRatio: categoryThicknessInfo.outerPaddingRatio,
                    margin: margin,
                    allowSingleScalarTick: this.data.isScalar,
                    preventNice: options.preventNiceX
                }), this.xAxisProperties.hasDisallowedZeroInDomain = hasZeroValueInXDomain, this.yAxisProperties.hasDisallowedZeroInDomain = hasZeroValueInYDomain, 
                [ this.xAxisProperties, this.yAxisProperties ];
            }, LineChart.prototype.enumerateObjectInstances = function(enumeration, options) {
                var data = this.data;
                if (data) switch (options.objectName) {
                  case "dataPoint":
                    this.enumerateDataPoints(enumeration);
                    break;

                  case "labels":
                    this.enumerateDataLabels(enumeration);
                    break;

                  case visuals.lineChartProps.lineStyles.strokeLineJoin.objectName:
                    LineChart.enumerateLineStyles(enumeration, data, this.dataView, this.lineMarkersEnabled, this.lineStylesEnabled);
                    break;

                  case visuals.ForecastHelper.forecastObjectName:
                    this.supportsForecast() && visuals.ForecastHelper.enumerateObjectInstances(enumeration, data.forecastLines);
                }
            }, LineChart.prototype.enumerateDataPoints = function(enumeration) {
                var data = this.data;
                data && data.series && 0 !== data.series.length && powerbi.requireSync("PowerBIVisuals/Visuals/common/colorEnumerationHelper").enumerateSeriesDataColors({
                    enumeration: enumeration,
                    dataPoints: _.map(data.series, function(series) {
                        return {
                            color: series.color,
                            displayName: series.seriesName,
                            identity: series.identity
                        };
                    })
                });
            }, LineChart.prototype.enumerateDataLabels = function(enumeration) {
                var data = this.data, labelSettings = this.data.dataLabelsSettings, seriesCount = data.series.length, showLabelPerSeries = this.showLabelPerSeries();
                if (visuals.LabelUtils.enumerateDataLabels(this.getLabelSettingsOptions(enumeration, labelSettings, null, showLabelPerSeries)), 
                0 !== seriesCount && showLabelPerSeries && labelSettings.showLabelPerSeries) for (var i = 0; i < seriesCount; i++) {
                    var series = data.series[i], labelSettings_2 = series.labelSettings ? series.labelSettings : this.data.dataLabelsSettings;
                    enumeration.pushContainer({
                        displayName: series.seriesName
                    }), visuals.LabelUtils.enumerateDataLabels(this.getLabelSettingsOptions(enumeration, labelSettings_2, series)), 
                    enumeration.popContainer();
                }
            }, LineChart.enumerateLineStyles = function(enumeration, data, dataView, lineMarkersEnabled, lineStylesEnabled) {
                var showSeries;
                data.series.length > 1 && (showSeries = powerbi.DataViewObjects.getValue(dataView && dataView.metadata && dataView.metadata.objects, visuals.lineChartProps.lineStyles.showSeries, !1));
                var enumerateMarkers = lineMarkersEnabled && !data.isScalar;
                if (visuals.LineStyle.enumerate({
                    enumeration: enumeration,
                    style: data.lineStyle,
                    showSeries: showSeries,
                    enumerateMarkers: enumerateMarkers,
                    enumerateStyle: lineStylesEnabled
                }), showSeries) for (var seriesIndex = 0, seriesCount = data.series.length; seriesIndex < seriesCount; seriesIndex++) {
                    var series = data.series[seriesIndex];
                    enumeration.pushContainer({
                        displayName: series.seriesName
                    }), visuals.LineStyle.enumerate({
                        enumeration: enumeration,
                        style: series.lineStyle,
                        enumerateMarkers: enumerateMarkers,
                        enumerateStyle: lineStylesEnabled,
                        selector: series.identity.getSelector()
                    }), enumeration.popContainer();
                }
            }, LineChart.prototype.supportsTrendLine = function() {
                var isScalar = !!this.data && this.data.isScalar;
                return !EnumExtensions.hasFlag(this.lineType, 16) && isScalar && this.data.hasValues;
            }, LineChart.prototype.supportsForecast = function() {
                var isScalar = !!this.data && this.data.isScalar;
                return !EnumExtensions.hasFlag(this.lineType, 16) && isScalar && this.data.hasValues && 1 === this.data.series.length && !this.hasLegend();
            }, LineChart.prototype.isStacked = function() {
                return EnumExtensions.hasFlag(this.lineType, 16);
            }, LineChart.prototype.shouldSuppressAnimation = function() {
                return !!this.suppressAnimation;
            }, LineChart.prototype.showLabelPerSeries = function() {
                var data = this.data;
                return !data.hasDynamicSeries && (data.series.length > 1 || !data.categoryMetadata);
            }, LineChart.prototype.getLabelSettingsOptions = function(enumeration, labelSettings, series, showAll) {
                return {
                    enumeration: enumeration,
                    dataLabelsSettings: labelSettings,
                    show: !0,
                    displayUnits: !0,
                    precision: !0,
                    selector: series && series.identity ? series.identity.getSelector() : null,
                    showAll: showAll,
                    fontSize: !0,
                    fontFamily: this.customFontFamilyForDataLabel,
                    labelDensity: this.data.isScalar
                };
            }, LineChart.prototype.overrideXScale = function(xProperties) {
                this.xAxisProperties = xProperties;
            }, LineChart.prototype.onClearSelection = function() {
                this.interactivityService && this.interactivityService.clearSelection();
            }, LineChart.prototype.render = function(suppressAnimations) {
                var duration = visuals.AnimatorCommon.GetAnimationDuration(this.animator, suppressAnimations);
                this.suppressAnimation && (duration = 0), this.previousCategoryCount = this.data.categoryData.length;
                var result, viewModel = this.buildViewModel(duration), renderContext = {
                    hoverLine: this.hoverLine,
                    hoverLineContext: this.hoverLineContext,
                    mainGraphicsContext: this.mainGraphicsContext,
                    svgDefs: this.svgDefs,
                    mainGraphicsSVG: this.mainGraphicsSVG
                };
                if (this.isInteractiveChart) {
                    var mobileRenderContext = $.extend(renderContext, {
                        dragHandle: this.dragHandle,
                        selectionCircles: this.selectionCircles
                    });
                    result = LineChart.renderOld(viewModel, mobileRenderContext, this.interactivityService, this, this, this.isInteractiveChart, suppressAnimations, this.markerRenderer), 
                    mobileRenderContext.dragHandle && (this.dragHandle = mobileRenderContext.dragHandle);
                } else result = LineChart.renderNew({
                    viewModel: viewModel,
                    renderContext: renderContext,
                    interactivityService: this.interactivityService,
                    plotAreaHelper: this,
                    tooltipService: this.tooltipService,
                    tooltipInteractivity: this,
                    markerRenderer: this.markerRenderer
                });
                return visuals.ForecastHelper.render(this.data.forecastLines, renderContext.mainGraphicsSVG, viewModel.xAxisProperties.scale, viewModel.yAxisProperties.scale, viewModel.currentViewport, viewModel.animationDuration), 
                visuals.SVGUtil.flushAllD3TransitionsIfNeeded(this.options), result;
            }, LineChart.prototype.buildViewModel = function(animationDuration) {
                return {
                    currentViewport: this.currentViewport,
                    data: this.clippedData ? this.clippedData : this.data,
                    animationDuration: animationDuration,
                    horizontalOffset: this.getXOfFirstCategory(),
                    isComboChart: this.isComboChart,
                    lineClassAndSelector: this.lineClassAndSelector,
                    lineType: this.lineType,
                    margin: this.margin,
                    scale: this.scaleDetector.getScale(),
                    tooltipsEnabled: this.tooltipsEnabled,
                    xAxisProperties: this.xAxisProperties,
                    yAxisProperties: this.yAxisProperties
                };
            }, LineChart.renderNew = function(options) {
                var viewModel = options.viewModel, renderContext = options.renderContext, plotAreaHelper = options.plotAreaHelper, tooltipService = options.tooltipService, tooltipInteractivity = options.tooltipInteractivity, data = options.viewModel.data, markerRenderer = options.markerRenderer;
                if (data) {
                    markerRenderer.ensureMarkers(options.renderContext.svgDefs, _.map(viewModel.data.series, function(series) {
                        return series.lineStyle.markerProperties;
                    }));
                    var duration = viewModel.animationDuration, dataPointCount = data.categories.length * data.series.length;
                    (dataPointCount > visuals.AnimatorCommon.MaxDataPointsToAnimate || markerRenderer.shouldDisableAnimations() && _.any(viewModel.data.series, function(series) {
                        return series.lineStyle.markerProperties.showMarker;
                    })) && (duration = 0);
                    var y0Position, yPosition, isStackedArea = EnumExtensions.hasFlag(viewModel.lineType, 16), margin = viewModel.margin, viewport = viewModel.currentViewport, height = viewport.height - (margin.top + margin.bottom), width = viewport.width - (margin.left + margin.right), xScale = viewModel.xAxisProperties.scale, yScale = viewModel.yAxisProperties.scale, horizontalOffset = viewModel.horizontalOffset, isScalar = data.isScalar, hasSelection = options.interactivityService && options.interactivityService.hasSelection(), isAreaChart = EnumExtensions.hasFlag(viewModel.lineType, 2) || EnumExtensions.hasFlag(viewModel.lineType, 16), renderAreas = isAreaChart || data.lineStyle.shadeArea || _.any(data.series, function(s) {
                        return s.lineStyle.shadeArea;
                    }), xPosition = function(d) {
                        return xScale(LineChart.getXValue(d, isScalar)) + horizontalOffset;
                    };
                    isStackedArea ? (y0Position = function(d) {
                        return yScale(d.stackedValue - d.value);
                    }, yPosition = function(d) {
                        return yScale(d.stackedValue);
                    }) : (y0Position = yScale(0), yPosition = function(d) {
                        return yScale(d.value);
                    });
                    var area;
                    renderAreas && (area = d3.svg.area().x(xPosition).y0(y0Position).y1(yPosition).defined(function(d) {
                        return d && null !== d.value;
                    }));
                    var line = d3.svg.line().x(xPosition).y(yPosition).defined(function(d) {
                        return d && null !== d.value;
                    });
                    EnumExtensions.hasFlag(viewModel.lineType, 4) && (line.interpolate("basis"), area && area.interpolate("basis")), 
                    renderContext.mainGraphicsSVG.attr("height", height).attr("width", width);
                    var areas;
                    renderAreas ? (areas = renderContext.mainGraphicsContext.selectAll(LineChart.CategoryAreaSelector.selector).data(_.filter(data.series, function(s) {
                        return isAreaChart || s.lineStyle && s.lineStyle.shadeArea;
                    }), function(d) {
                        return d.identity.getKey();
                    }), areas.enter().append(LineChart.PathElementName).classed(LineChart.CategoryAreaSelector.class, !0), 
                    areas.style("fill", function(d) {
                        return d.color;
                    }).style("fill-opacity", function(d) {
                        return hasSelection && !d.selected ? LineChart.DimmedAreaFillOpacity : LineChart.AreaFillOpacity;
                    }).transition().ease("linear").duration(duration).attr("d", function(d) {
                        return area(d.data);
                    }), areas.exit().remove()) : areas = renderContext.mainGraphicsContext.selectAll(LineChart.CategoryAreaSelector.selector).remove();
                    var lines = renderContext.mainGraphicsContext.selectAll(viewModel.lineClassAndSelector.selector).data(data.series, function(d) {
                        return d.identity.getKey();
                    });
                    lines.enter().append(LineChart.PathElementName).classed(viewModel.lineClassAndSelector.class, !0), 
                    lines.style("stroke", function(d) {
                        return d.color;
                    }).style("stroke-opacity", function(d) {
                        return visuals.ColumnUtil.getFillOpacity(d.selected, !1, hasSelection, !1);
                    }).style("stroke-width", function(d) {
                        return d.lineStyle.strokeWidth;
                    }).style("stroke-linejoin", function(d) {
                        return d.lineStyle.lineJoin;
                    }).style("stroke-dasharray", function(d) {
                        return visuals.LineStyle.getStrokeDashArrayFromLineStyle(d.lineStyle.style);
                    }).transition().ease("linear").duration(duration).attr("d", function(d) {
                        return line(d.data);
                    }), lines.exit().remove();
                    var markerPaths = renderContext.mainGraphicsContext.selectAll(LineChart.MarkerLineClassSelector.selector).data(_.filter(data.series, function(series) {
                        return series.lineStyle.markerProperties.showMarker;
                    }), function(d) {
                        return d.identity.getKey();
                    });
                    markerPaths.enter().append(LineChart.PathElementName).classed(LineChart.MarkerLineClassSelector.class, !0).style("stroke", "#ffffff").style("stroke-width", visuals.CartesianHelper.defaultLineStrokeWidth).style("stroke-opacity", 0);
                    var markerTransition = markerPaths.transition().ease("linear").duration(duration).attr("d", function(d) {
                        return line(d.data);
                    }).style("opacity", function(d) {
                        return visuals.ColumnUtil.getFillOpacity(d.selected, !1, hasSelection, !1);
                    }).style("pointer-events", "none");
                    markerRenderer.renderMarkers(markerTransition), markerPaths.exit().remove();
                    var interactivityLines = renderContext.mainGraphicsContext.selectAll(LineChart.InteractivityLineClassSelector.selector).data(data.series, function(d) {
                        return d.identity.getKey();
                    });
                    interactivityLines.enter().append(LineChart.PathElementName).classed(LineChart.InteractivityLineClassSelector.class, !0).style("stroke-width", LineChart.interactivityStrokeWidth).style("stroke-linejoin", visuals.strokeLineJoin.round), 
                    interactivityLines.attr("d", function(series) {
                        if (!isScalar) {
                            var firstPathPoint = LineChart.getFirstPathPointFromSeriesData(series);
                            if (firstPathPoint) {
                                var firstNonNullDataPoint = _.find(series.data, function(dp) {
                                    return dp && null != dp.value;
                                });
                                if (firstNonNullDataPoint && firstNonNullDataPoint.categoryIndex !== firstPathPoint.categoryIndex) {
                                    var seriesDataThatAlwaysStartsWithALineSegment = series.data.slice(firstPathPoint.categoryIndex - firstNonNullDataPoint.categoryIndex);
                                    return line(seriesDataThatAlwaysStartsWithALineSegment);
                                }
                            }
                        }
                        return line(series.data);
                    }), interactivityLines.exit().remove();
                    var dotGroups = renderContext.mainGraphicsContext.selectAll(LineChart.CategorySelector.selector).data(data.series, function(d) {
                        return d.identity.getKey();
                    });
                    dotGroups.enter().append("g").classed(LineChart.CategorySelector.class, !0), dotGroups.exit().remove();
                    var dots = dotGroups.selectAll(LineChart.CategoryValuePoint.selector).data(function(series) {
                        return series.data.filter(function(value, i) {
                            return LineChart.shouldDrawCircle(series, i);
                        });
                    }, function(d) {
                        return d.key;
                    });
                    dots.enter().append(LineChart.CircleElementName).classed(LineChart.CategoryValuePoint.class, !0), 
                    dots.style("fill", function() {
                        var lineSeries = d3.select(this.parentNode).datum();
                        return lineSeries.color;
                    }).style("fill-opacity", function() {
                        var lineSeries = d3.select(this.parentNode).datum();
                        return lineSeries.lineStyle.markerProperties.showMarker ? 0 : visuals.ColumnUtil.getFillOpacity(lineSeries.selected, !1, hasSelection, !1);
                    }).transition().duration(duration).attr({
                        cx: function(d, i) {
                            return xScale(LineChart.getXValue(d, isScalar)) + horizontalOffset;
                        },
                        cy: function(d, i) {
                            return yScale(isStackedArea ? d.stackedValue : d.value);
                        },
                        r: data.lineStyle.strokeWidth / 2 + LineChart.CircleRadiusExtra
                    }), dots.exit().remove();
                    var explicitDots;
                    !viewModel.isComboChart && isScalar && (explicitDots = dotGroups.selectAll(LineChart.CategoryPointSelector.selector).data(function(series) {
                        return _.filter(series.data, function(value) {
                            return value && null != value.pointColor;
                        });
                    }, function(d) {
                        return d.key;
                    }), explicitDots.enter().append(LineChart.CircleElementName).classed(LineChart.CategoryPointSelector.class, !0), 
                    explicitDots.style("fill", function(d) {
                        return d.pointColor;
                    }).transition().duration(duration).attr({
                        cx: function(d) {
                            return xScale(LineChart.getXValue(d, isScalar));
                        },
                        cy: function(d) {
                            return yScale(isStackedArea ? d.stackedValue : d.value);
                        },
                        r: data.lineStyle.strokeWidth / 2 + LineChart.PointRadiusExtra
                    }), explicitDots.exit().remove());
                    var labelDataPointGroups;
                    if (data.dataLabelsSettings.show && (labelDataPointGroups = LineChart.createLabelDataPoints(viewModel)), 
                    viewModel.tooltipsEnabled) {
                        var tooltipContext = {
                            width: width,
                            height: height,
                            interactivityLines: interactivityLines,
                            dots: dots,
                            explicitDots: explicitDots,
                            isComboChart: viewModel.isComboChart,
                            binnedLineSamplingApplied: data.binnedLineSamplingApplied,
                            hasDynamicSeries: data.hasDynamicSeries
                        };
                        tooltipService.applyTooltips(tooltipContext, plotAreaHelper, tooltipInteractivity);
                    }
                    var dataPointsToBind, behaviorOptions;
                    if (options.interactivityService) {
                        dataPointsToBind = data.series.slice();
                        for (var i = 0, ilen = data.series.length; i < ilen; i++) for (var _i = 0, _a = data.series[i].data; _i < _a.length; _i++) {
                            var dataPoint = _a[_i];
                            null != dataPoint && dataPointsToBind.push(dataPoint);
                        }
                        behaviorOptions = {
                            lines: lines,
                            interactivityLines: interactivityLines,
                            dots: dots,
                            areas: areas,
                            tooltipOverlay: tooltipService.getTooltipOverlayElement(),
                            getCategoryIndex: function(seriesData, pointX, constrainToSeries) {
                                return constrainToSeries = constrainToSeries && !tooltipService.usingHoverLine, 
                                plotAreaHelper.getCategoryIndexFromSeriesAndPointX(seriesData, pointX, constrainToSeries);
                            },
                            categoryIdentities: data.categoryIdentities,
                            markerPaths: markerPaths
                        };
                    }
                    return {
                        dataPoints: dataPointsToBind,
                        behaviorOptions: behaviorOptions,
                        labelDataPoints: [],
                        labelsAreNumeric: !0,
                        labelDataPointGroups: labelDataPointGroups,
                        animateLabels: !1
                    };
                }
            }, LineChart.renderOld = function(viewModel, renderContext, interactivityService, plotAreaHelper, tooltipInteractivity, isInteractiveChart, suppressAnimation, markerRenderer) {
                var data = viewModel.data;
                if (data) {
                    var margin = viewModel.margin, viewport = viewModel.currentViewport, height = viewport.height - (margin.top + margin.bottom), xScale = viewModel.xAxisProperties.scale, yScale = viewModel.yAxisProperties.scale, isScalar = data.isScalar, animationDuration = viewModel.animationDuration;
                    markerRenderer.shouldDisableAnimations() && (animationDuration = 0);
                    var area, availableWidth = viewport.width - (margin.left + margin.right), availableHeight = viewport.height - (margin.top + margin.bottom), hasSelection = interactivityService && interactivityService.hasSelection(), isAreaChart = EnumExtensions.hasFlag(viewModel.lineType, 16) || EnumExtensions.hasFlag(viewModel.lineType, 2), renderAreas = isAreaChart || data.lineStyle.shadeArea || _.any(data.series, function(s) {
                        return s.lineStyle.shadeArea;
                    });
                    renderAreas && (area = d3.svg.area().x(function(d) {
                        return xScale(LineChart.getXValue(d, isScalar));
                    }).y0(height).y1(function(d) {
                        return yScale(d.value);
                    }).defined(function(d) {
                        return null !== d.value;
                    }));
                    var line = d3.svg.line().x(function(d) {
                        return xScale(LineChart.getXValue(d, isScalar));
                    }).y(function(d) {
                        return yScale(d.value);
                    }).defined(function(d) {
                        return !!d && null !== d.value;
                    });
                    EnumExtensions.hasFlag(viewModel.lineType, 4) && (line.interpolate("basis"), area && area.interpolate("basis"));
                    var firstCategoryOffset = viewModel.horizontalOffset;
                    if (renderContext.mainGraphicsContext.attr("transform", visuals.SVGUtil.translate(firstCategoryOffset, 0)), 
                    renderContext.mainGraphicsSVG.attr("height", availableHeight).attr("width", availableWidth), 
                    renderContext.hoverLineContext.attr("transform", visuals.SVGUtil.translate(firstCategoryOffset, 0)), 
                    renderAreas) {
                        var catAreaSelect = renderContext.mainGraphicsContext.selectAll(LineChart.CategoryAreaSelector.selector).data(_.filter(data.series, function(s) {
                            return isAreaChart || s.lineStyle && s.lineStyle.shadeArea;
                        }), function(d) {
                            return d.identity.getKey();
                        }), catAreaEnter = catAreaSelect.enter().append("g").classed(LineChart.CategoryAreaSelector.class, !0);
                        catAreaEnter.append(LineChart.PathElementName);
                        var catAreaUpdate = renderContext.mainGraphicsContext.selectAll(LineChart.CategoryAreaSelector.selector);
                        catAreaUpdate.select(LineChart.PathElementName).transition().ease("linear").duration(animationDuration).attr("d", function(d) {
                            return area(d.data);
                        }).style("fill", function(d) {
                            return d.color;
                        }).style("fill-opacity", function(d) {
                            return hasSelection && !d.selected ? LineChart.DimmedAreaFillOpacity : LineChart.AreaFillOpacity;
                        }), catAreaSelect.exit().remove();
                    } else renderContext.mainGraphicsContext.selectAll(LineChart.CategoryAreaSelector.selector).remove();
                    var catSelect = renderContext.mainGraphicsContext.selectAll(LineChart.CategorySelector.selector).data(data.series, function(d) {
                        return d.identity.getKey();
                    }), catEnter = catSelect.enter().append("g").classed(LineChart.CategorySelector.class, !0);
                    if (catEnter.append(LineChart.PathElementName), catEnter.selectAll(LineChart.CategoryValuePoint.selector).data(function(d) {
                        return d.data;
                    }).enter().append(LineChart.CircleElementName).classed(LineChart.CategoryValuePoint.class, !0), 
                    catSelect.exit().remove(), isInteractiveChart && !renderContext.dragHandle) {
                        var handleTop = availableHeight;
                        renderContext.dragHandle = renderContext.hoverLineContext.append("circle").attr("cx", 0).attr("cy", handleTop).attr("r", "6px").classed("drag-handle", !0);
                    }
                    for (var linesCount = catSelect.data().length; renderContext.selectionCircles.length < linesCount; ) {
                        var addedCircle = renderContext.hoverLineContext.append(LineChart.CircleElementName).classed(LineChart.CircleClassName, !0).attr("r", data.lineStyle.strokeWidth / 2 + LineChart.CircleRadiusExtra).style("opacity", 0);
                        renderContext.selectionCircles.push(addedCircle);
                    }
                    for (;renderContext.selectionCircles.length > linesCount; ) renderContext.selectionCircles.pop().remove();
                    var catUpdate = renderContext.mainGraphicsContext.selectAll(LineChart.CategorySelector.selector), lineSelection = catUpdate.select(LineChart.PathElementName).classed(viewModel.lineClassAndSelector.class, !0).style("stroke", function(d) {
                        return d.color;
                    }).style("stroke-opacity", function(d) {
                        return visuals.ColumnUtil.getFillOpacity(d.selected, !1, hasSelection, !1);
                    }).style("stroke-width", data.lineStyle.strokeWidth).style("stroke-linejoin", data.lineStyle.lineJoin);
                    lineSelection.transition().ease("linear").duration(animationDuration).attr("d", function(d) {
                        return line(d.data);
                    }), markerRenderer.ensureMarkers(renderContext.svgDefs, _.map(viewModel.data.series, function(series) {
                        return series.lineStyle.markerProperties;
                    }));
                    var markerPaths = renderContext.mainGraphicsContext.selectAll(LineChart.MarkerLineClassSelector.selector).data(_.filter(data.series, function(series) {
                        return series.lineStyle.markerProperties.showMarker;
                    }), function(d) {
                        return d.identity.getKey();
                    });
                    markerPaths.enter().append(LineChart.PathElementName).classed(LineChart.MarkerLineClassSelector.class, !0).style("stroke", "#ffffff").style("stroke-width", visuals.CartesianHelper.defaultLineStrokeWidth).style("stroke-opacity", 0);
                    var markerTransition = markerPaths.transition().ease("linear").duration(animationDuration).attr("d", function(d) {
                        return line(d.data);
                    }).style("opacity", function(d) {
                        return visuals.ColumnUtil.getFillOpacity(d.selected, !1, hasSelection, !1);
                    }).style("pointer-events", "none");
                    markerRenderer.renderMarkers(markerTransition), markerPaths.exit().remove();
                    var that = this, updateSelection = catUpdate.selectAll(LineChart.CategoryValuePoint.selector), transitions = updateSelection.style("fill", function() {
                        var lineSeries = d3.select(this.parentNode).datum();
                        return lineSeries.color;
                    }).style("fill-opacity", function() {
                        var lineSeries = d3.select(this.parentNode).datum();
                        return visuals.ColumnUtil.getFillOpacity(lineSeries.selected, !1, hasSelection, !1);
                    }).transition().duration(animationDuration).attr({
                        cx: function(d, i) {
                            var lineSeries = d3.select(this.parentNode).datum(), circleIndex = that.shouldDrawCircle(lineSeries, i);
                            return circleIndex ? xScale(that.getXValue(d, isScalar)) : 0;
                        },
                        cy: function(d, i) {
                            var lineSeries = d3.select(this.parentNode).datum(), circleIndex = that.shouldDrawCircle(lineSeries, i);
                            return circleIndex ? yScale(d.value) : 0;
                        },
                        r: function(d, i) {
                            var lineSeries = d3.select(this.parentNode).datum(), circleIndex = that.shouldDrawCircle(lineSeries, i);
                            return circleIndex ? data.lineStyle.strokeWidth / 2 + LineChart.CircleRadiusExtra : 0;
                        }
                    });
                    if (isInteractiveChart && LineChart.hasDataPoint(data.series)) {
                        var selectionSize_1 = updateSelection.size(), endedTransitionCount_1 = 0;
                        transitions.each("end", function() {
                            endedTransitionCount_1++, endedTransitionCount_1 === selectionSize_1 && tooltipInteractivity.selectColumn(visuals.CartesianHelper.findMaxCategoryIndex(data.series), !0);
                        });
                    }
                    var dataPoints = null;
                    if (data.dataLabelsSettings.show) {
                        dataPoints = [];
                        for (var i = 0, ilen = data.series.length; i < ilen; i++) Array.prototype.push.apply(dataPoints, data.series[i].data);
                    }
                    catSelect.exit().remove();
                    var labelDataPointsGroups;
                    return data.dataLabelsSettings.show && (labelDataPointsGroups = LineChart.createLabelDataPoints(viewModel)), 
                    null == dataPoints ? null : {
                        dataPoints: dataPoints,
                        behaviorOptions: null,
                        labelDataPoints: null,
                        labelsAreNumeric: null,
                        labelDataPointGroups: labelDataPointsGroups,
                        animateLabels: !suppressAnimation
                    };
                }
            }, LineChart.getFirstPathPointFromSeriesData = function(seriesData) {
                var firstPathPoint = _.find(seriesData.data, function(dataPoint, index, dataPoints) {
                    var nextDataPoint = dataPoints[index + 1];
                    return null != dataPoint && null != dataPoint.value && null != nextDataPoint && null != nextDataPoint.value;
                });
                return firstPathPoint;
            }, LineChart.getSeriesTooltipInfo = function(hoverLineData) {
                if (!hoverLineData) return null;
                var pointData = hoverLineData.dataPoints;
                if (_.isEmpty(pointData)) return null;
                var transparentColor = "#000000", hiddenItemOpacity = "0", maxNumberOfItems = 10, hasDynamicSeries = !_.isEmpty(pointData) && pointData[0].seriesDisplayName, tooltipinfo = [], count = 0, legendMarkerRenderingOption = hoverLineData.legendMarkerRendering, useLineStyle = legendMarkerRenderingOption !== visuals.legendMarkerRendering.markerOnly;
                if (_.any(pointData, function(point) {
                    return !_.isEmpty(point.additionalTooltipItems);
                })) for (var _a = 0, pointData_2 = pointData; _a < pointData_2.length; _a++) {
                    var point = pointData_2[_a];
                    if (count >= maxNumberOfItems) break;
                    if (null != point.value && (hasDynamicSeries && (tooltipinfo.push({
                        header: point.category,
                        displayName: point.seriesDisplayName,
                        value: point.seriesName,
                        markerShape: point.markerShape,
                        lineStyle: useLineStyle ? point.lineStyle : void 0,
                        lineColor: point.lineColor
                    }), count++), tooltipinfo.push({
                        header: point.category,
                        color: point.color,
                        displayName: point.measureDisplayName,
                        value: point.measure,
                        markerShape: point.markerShape,
                        lineStyle: useLineStyle ? point.lineStyle : void 0,
                        lineColor: point.lineColor
                    }), count++, !_.isEmpty(point.additionalTooltipItems))) for (var _b = 0, _c = point.additionalTooltipItems; _b < _c.length; _b++) {
                        var additionalTooltipItem = _c[_b];
                        if (count >= maxNumberOfItems) break;
                        tooltipinfo.push({
                            header: point.category,
                            color: transparentColor,
                            displayName: additionalTooltipItem.displayName,
                            value: additionalTooltipItem.value,
                            opacity: hiddenItemOpacity,
                            markerShape: visuals.markerShape.none
                        }), count++;
                    }
                } else for (var _i = 0, pointData_1 = pointData; _i < pointData_1.length; _i++) {
                    var point = pointData_1[_i];
                    if (count >= maxNumberOfItems) break;
                    null != point.value && (tooltipinfo.push({
                        header: point.category,
                        color: point.color,
                        displayName: point.seriesName || point.measureDisplayName,
                        value: point.measure,
                        markerShape: point.markerShape,
                        lineStyle: useLineStyle ? point.lineStyle : void 0,
                        lineColor: point.lineColor
                    }), count++);
                }
                if (!_.isEmpty(hoverLineData.additionalTooltipItems)) for (var _d = 0, _e = hoverLineData.additionalTooltipItems; _d < _e.length; _d++) {
                    var additionalTooltipItem = _e[_d];
                    if (count >= maxNumberOfItems) break;
                    tooltipinfo.push({
                        header: pointData[0].category,
                        color: transparentColor,
                        displayName: additionalTooltipItem.displayName,
                        value: additionalTooltipItem.value,
                        opacity: hiddenItemOpacity,
                        markerShape: visuals.markerShape.none
                    }), count++;
                }
                return 0 === tooltipinfo.length ? null : tooltipinfo;
            }, LineChart.prototype.getTooltipInfoForPoint = function(tooltipEvent, pointX) {
                var dataPoint, seriesData = tooltipEvent.data, categoryIndex = this.getCategoryIndexFromSeriesAndPointX(seriesData, pointX, !0);
                if (seriesData && seriesData.data && seriesData.data.length && (dataPoint = _.find(seriesData.data, function(dp) {
                    return dp && dp.categoryIndex === categoryIndex;
                })), dataPoint) return dataPoint.tooltipInfo;
            }, LineChart.isDataPointData = function(data) {
                return data && null != data.categoryIndex;
            }, LineChart.isForecastPoint = function(data) {
                return data && null != data.points;
            }, LineChart.prototype.getCategoryIndexFromTooltipEvent = function(tooltipEvent, pointX) {
                var data = tooltipEvent.data;
                if (!LineChart.isForecastPoint(data)) return LineChart.isDataPointData(data) ? data.categoryIndex : this.getCategoryIndexFromSeriesAndPointX(data, pointX, !1);
            }, LineChart.prototype.getCategoryIndexFromSeriesAndPointX = function(seriesData, pointX, constrainToSeries) {
                var offsetX = 0, categoryData = this.data.categoryData;
                if (seriesData && !_.isEmpty(seriesData.data) && this.xAxisProperties) {
                    pointX = this.adjustPathXCoordinate(pointX);
                    var firstPathPoint = LineChart.getFirstPathPointFromSeriesData(seriesData);
                    offsetX = this.xAxisProperties.scale(LineChart.getXValue(firstPathPoint, this.data.isScalar)) + this.getXOfFirstCategory(), 
                    constrainToSeries && (categoryData = seriesData.data);
                }
                return this.findCategoryIndex(pointX, offsetX, categoryData);
            }, LineChart.prototype.getVisualCategoryAxisIsScalar = function() {
                return !!this.data && this.data.isScalar;
            }, LineChart.prototype.getSupportedCategoryAxisType = function() {
                var dvCategories = this.dataView && this.dataView.categorical ? this.dataView.categorical.categories : void 0, categoryType = {
                    text: !0
                };
                if (!_.isEmpty(dvCategories)) return visuals.axisType.both;
                var isOrdinal = visuals.AxisHelper.isOrdinal(categoryType);
                return isOrdinal ? visuals.axisType.categorical : visuals.axisType.both;
            }, LineChart.prototype.getPreferredPlotArea = function(isScalar, categoryCount, categoryThickness, outerPaddingRatio) {
                return void 0 === outerPaddingRatio && (outerPaddingRatio = 0), visuals.CartesianChart.getPreferredPlotArea(categoryCount, categoryThickness, this.currentViewport, this.isScrollable, isScalar, this.margin, outerPaddingRatio);
            }, LineChart.prototype.getCategoryCount = function(origCatgSize, outerPaddingRatio) {
                var availableWidth = this.getAvailableWidth(), categoryThickness = visuals.CartesianHelper.MinOrdinalRectThickness;
                return Math.min(Math.round((availableWidth - categoryThickness * outerPaddingRatio * 2) / categoryThickness), origCatgSize);
            }, LineChart.prototype.getAvailableWidth = function() {
                return this.currentViewport.width - (this.margin.left + this.margin.right);
            }, LineChart.prototype.getAvailableHeight = function() {
                return this.currentViewport.height - (this.margin.top + this.margin.bottom);
            }, LineChart.sliceSeries = function(series, newLength, startIndex) {
                void 0 === startIndex && (startIndex = 0);
                var newSeries = [];
                if (series && series.length > 0) for (var i = 0, len = series.length; i < len; i++) newSeries[i] = powerbi.Prototype.inherit(series[i]), 
                newSeries[i].data = series[i].data.slice(startIndex, startIndex + newLength);
                return newSeries;
            }, LineChart.prototype.getXOfFirstCategory = function() {
                if (!this.data.isScalar) {
                    var xScale = this.xAxisProperties.scale;
                    if (xScale.rangeBand) return xScale.rangeBand() / 2;
                }
                return 0;
            }, LineChart.hasDataPoint = function(series) {
                if (0 === series.length) return !1;
                for (var i = 0, len = series.length; i < len; i++) if (series[i].data.length > 0) return !0;
                return !1;
            }, LineChart.getXValue = function(d, isScalar) {
                return isScalar ? d.categoryValue : d.categoryIndex;
            }, LineChart.shouldDrawCircle = function(d, i) {
                var current = d.data[i];
                if (null == current || null === current.value) return !1;
                var previous = d.data[i - 1], isPreviousNull = null == previous || null === previous.value, next = d.data[i + 1], isNextNull = null == next || null === next.value;
                return isPreviousNull && isNextNull;
            }, LineChart.prototype.getHoverLineDataForCategory = function(columnIndex, force) {
                void 0 === force && (force = !1);
                var x = this.getChartX(columnIndex) + this.getXOfFirstCategory(), hoverLineData = this.createTooltipData(columnIndex);
                if (hoverLineData) {
                    var dataPoints = hoverLineData.dataPoints;
                    return hoverLineData.dataPoints.length > 0 && this.setHoverLineForTooltip(x), this.setDotsForTooltip(x, dataPoints, this.data.lineStyle.strokeWidth / 2 + LineChart.TooltipCircleRadiusExtra), 
                    hoverLineData;
                }
            }, LineChart.prototype.setHoverLineForTooltip = function(chartX) {
                chartX = chartX || 0, this.hoverLine.attr("x1", chartX).attr("x2", chartX).attr("y1", 0).attr("y2", this.getAvailableHeight()).style("opacity", 1);
            }, LineChart.prototype.clearHoverLine = function() {
                this.hoverLine.style("opacity", visuals.SVGUtil.AlmostZero), this.hoverLineContext.selectAll(LineChart.HoverLineCircleDot.selector).remove();
            }, LineChart.prototype.setDotsForTooltip = function(chartX, dataPoints, radius) {
                var _this = this;
                void 0 === radius && (radius = 3);
                var isStackedArea = EnumExtensions.hasFlag(this.lineType, 16), dotYPosition = isStackedArea ? function(d) {
                    return _this.yAxisProperties.scale(d.stackedValue);
                } : function(d) {
                    return _this.yAxisProperties.scale(d.value);
                }, tooltipDots = this.hoverLineContext.selectAll(LineChart.HoverLineCircleDot.selector).data(_.filter(dataPoints, function(dataPoint) {
                    return dataPoint.showDot;
                }));
                tooltipDots.enter().append(LineChart.CircleElementName).classed(LineChart.HoverLineCircleDot.class, !0), 
                tooltipDots.filter(function(d) {
                    return d.value;
                }).attr("fill", function(d) {
                    return d.color;
                }).attr("r", radius).attr("cx", chartX).attr("cy", dotYPosition), tooltipDots.exit().remove();
            }, LineChart.prototype.selectColumn = function(columnIndex, force) {
                if (void 0 === force && (force = !1), force || this.lastInteractiveSelectedColumnIndex !== columnIndex) {
                    this.lastInteractiveSelectedColumnIndex = columnIndex;
                    var x = this.getChartX(columnIndex);
                    this.setHoverLine(x, columnIndex);
                    var legendItems = this.createLegendDataPoints(columnIndex);
                    legendItems && this.options.cartesianHost.updateLegend(legendItems);
                }
            }, LineChart.prototype.setHoverLine = function(chartX, columnIndex) {
                this.hoverLine.attr("x1", chartX).attr("x2", chartX).attr("y1", 0).attr("y2", this.getAvailableHeight()).style("opacity", 1);
                var that = this;
                this.mainGraphicsContext.selectAll(LineChart.CategorySelector.selector).selectAll(LineChart.PathElementName).each(function(series) {
                    var _this = this, color = series.color, circleToChange = that.selectionCircles[series.lineIndex];
                    circleToChange && circleToChange.attr({
                        cx: chartX,
                        cy: function() {
                            var pathElement = d3.select(_this).node(), pos = that.getPosition(chartX, pathElement);
                            return pos.y;
                        }
                    }).style({
                        opacity: function() {
                            return _.some(series.data, function(value) {
                                return !!value && value.categoryIndex === columnIndex;
                            }) ? 1 : 0;
                        },
                        fill: color
                    }), that.dragHandle && that.dragHandle.attr("cx", chartX);
                });
            }, LineChart.prototype.getChartX = function(columnIndex) {
                var x = 0;
                this.data.isScalar ? columnIndex >= 0 && columnIndex < this.data.categoryData.length && (x = Math.max(0, this.xAxisProperties.scale(this.data.categoryData[columnIndex].categoryValue))) : x = Math.max(0, this.xAxisProperties.scale(columnIndex));
                var rangeEnd = powerbi.visuals.AxisHelper.extent(this.xAxisProperties.scale)[1];
                return x = Math.min(x, rangeEnd), isNaN(x) ? 0 : x;
            }, LineChart.prototype.findCategoryIndex = function(pointX, offsetX, categoryData) {
                var xScale = this.scaleDetector.getScale().x;
                powerbi.Double.equalWithPrecision(xScale, 1, 1e-5) || (pointX /= xScale), offsetX && (pointX += offsetX);
                var categoryIndex = powerbi.visuals.AxisHelper.invertScale(this.xAxisProperties.scale, pointX);
                if (this.data.isScalar) {
                    var index = visuals.AxisHelper.findClosestXAxisIndex(categoryIndex, categoryData);
                    categoryIndex = index >= 0 ? categoryData[index].categoryIndex : -1;
                }
                return categoryIndex;
            }, LineChart.prototype.getPosition = function(x, pathElement) {
                for (var pos, target, pathLength = pathElement.getTotalLength(), beginning = 0, end = pathLength; ;) {
                    if (target = beginning + end >> 1, pos = pathElement.getPointAtLength(target), visuals.SVGUtil.ensureValidSVGPoint(pos), 
                    (target === end || target === beginning) && pos.x !== x) break;
                    if (pos.x > x) end = target; else {
                        if (!(pos.x < x)) break;
                        beginning = target;
                    }
                }
                return pos;
            }, LineChart.prototype.createTooltipData = function(columnIndex) {
                var data = this.data;
                if (data && 0 !== data.series.length && data.categories && data.categoryData) {
                    var category, dataPoints = [], categoryDataPoint = data.categoryData[columnIndex];
                    this.data.isScalar ? categoryDataPoint && (category = visuals.AxisHelper.isDateTime(this.xAxisProperties.axisType) && !data.scalarMetadata ? visuals.CartesianHelper.lookupXValue(this.data, categoryDataPoint.categoryValue, this.xAxisProperties.axisType, this.data.isScalar) : data.categories[columnIndex]) : category = visuals.CartesianHelper.lookupXValue(this.data, columnIndex, this.xAxisProperties.axisType, this.data.isScalar);
                    for (var additionalTooltipItems, formatStringProp = visuals.lineChartProps.general.formatString, _i = 0, _a = data.series; _i < _a.length; _i++) {
                        var series = _a[_i], lineData = series.data, lineDataPoint = void 0;
                        this.data.isScalar ? categoryDataPoint && (lineDataPoint = lineData.filter(function(data) {
                            return data.categoryValue === categoryDataPoint.categoryValue;
                        })[0]) : lineDataPoint = lineData[columnIndex];
                        var value = lineDataPoint && lineDataPoint.value;
                        if (null != value) {
                            var concatenatedCategoryLevel = visuals.CategoryLevelUtils.concatenateCategoryLevels(categoryDataPoint.hierarchyCategoryLevels), markerProperties = series.lineStyle.markerProperties, dataPoint = {
                                color: visuals.Markers.resolveMarkerColor(markerProperties, series.color, data.legendMarkerRendering, data.matchLineColor),
                                category: concatenatedCategoryLevel.value,
                                measureDisplayName: series.seriesName,
                                measure: visuals.valueFormatter.format(value, visuals.valueFormatter.getFormatString(series.yCol, formatStringProp)),
                                value: value,
                                stackedValue: lineDataPoint.stackedValue,
                                showDot: !markerProperties.showMarker,
                                markerShape: visuals.Markers.resolveMarkerShape(markerProperties, data.legendMarkerRendering, data.defaultToCircle ? visuals.markerShape.circle : visuals.markerShape.longDash),
                                lineStyle: series.lineStyle.style,
                                lineColor: series.color
                            };
                            data.hasDynamicSeries ? (dataPoint.seriesDisplayName = data.seriesDisplayName, dataPoint.seriesName = series.seriesName, 
                            dataPoint.additionalTooltipItems = lineDataPoint.additionalTooltipItems) : additionalTooltipItems || (additionalTooltipItems = lineDataPoint.additionalTooltipItems), 
                            dataPoints.push(dataPoint);
                        }
                    }
                    if (!_.isEmpty(data.forecastLines)) for (var series = _.first(data.series), _b = 0, _c = data.forecastLines; _b < _c.length; _b++) {
                        var forecastLine = _c[_b], forecastDataPoint = _(forecastLine.points).filter(function(point) {
                            return point.point.x === categoryDataPoint.categoryValue;
                        }).first(), value = forecastDataPoint && forecastDataPoint.point.y;
                        if (null != value) {
                            var dataPoint = {
                                color: forecastLine.lineColor.solid.color,
                                category: visuals.valueFormatter.format(category, visuals.valueFormatter.getFormatString(series.xCol, formatStringProp)),
                                measureDisplayName: forecastLine.displayName,
                                measure: visuals.valueFormatter.format(value, visuals.valueFormatter.getFormatString(series.yCol, formatStringProp)),
                                value: value,
                                stackedValue: void 0,
                                additionalTooltipItems: [ {
                                    displayName: this.host.getLocalizedString("Visual_Confidence_Band_Upper"),
                                    value: visuals.valueFormatter.format(forecastDataPoint.upperBound.y, visuals.valueFormatter.getFormatString(series.yCol, formatStringProp))
                                }, {
                                    displayName: this.host.getLocalizedString("Visual_Confidence_Band_Lower"),
                                    value: visuals.valueFormatter.format(forecastDataPoint.lowerBound.y, visuals.valueFormatter.getFormatString(series.yCol, formatStringProp))
                                } ],
                                showDot: !0,
                                markerShape: visuals.markerShape.circle,
                                lineStyle: void 0,
                                lineColor: void 0
                            };
                            dataPoints.push(dataPoint);
                        }
                    }
                    return {
                        dataPoints: dataPoints,
                        additionalTooltipItems: additionalTooltipItems,
                        legendMarkerRendering: data.legendMarkerRendering
                    };
                }
            }, LineChart.prototype.createLegendDataPoints = function(columnIndex) {
                var data = this.data;
                if (data && data.series && !(data.series.length < 1)) {
                    var category, legendDataPoints = [], categoryDataPoint = data.categoryData[columnIndex];
                    this.isInteractiveChart && categoryDataPoint && (this.data.isScalar ? (category = categoryDataPoint.categoryValue, 
                    visuals.AxisHelper.isDateTime(this.xAxisProperties.axisType) && (category = new Date(category))) : category = visuals.CartesianHelper.lookupXValue(this.data, columnIndex, this.xAxisProperties.axisType, this.data.isScalar));
                    for (var formatStringProp = visuals.lineChartProps.general.formatString, seriesYCol = null, i = 0, len = data.series.length; i < len; i++) {
                        var series = data.series[i], lineData = series.data, measure = void 0;
                        if (this.isInteractiveChart) {
                            var lineDataPoint = void 0;
                            if (this.data.isScalar) {
                                if (categoryDataPoint) for (var targetCategoryValue = categoryDataPoint.categoryValue, i_1 = 0; i_1 < lineData.length; i_1++) if (lineData[i_1].categoryValue === targetCategoryValue) {
                                    lineDataPoint = lineData[i_1];
                                    break;
                                }
                            } else lineDataPoint = lineData[columnIndex];
                            measure = lineDataPoint && lineDataPoint.value;
                        }
                        var label = visuals.converterHelper.getFormattedLegendLabel(series.yCol, this.dataView.categorical.values, formatStringProp);
                        seriesYCol = series.yCol, legendDataPoints.push({
                            color: series.color,
                            icon: visuals.LegendIcon.Line,
                            label: label,
                            category: visuals.valueFormatter.format(category, visuals.valueFormatter.getFormatString(series.xCol, formatStringProp)),
                            measure: visuals.valueFormatter.format(measure, visuals.valueFormatter.getFormatString(series.yCol, formatStringProp)),
                            identity: series.identity,
                            selected: series.selected
                        });
                    }
                    var dvValues = this.dataView && this.dataView.categorical ? this.dataView.categorical.values : null, title = dvValues && dvValues.source ? dvValues.source.displayName : "", legendData = visuals.Legend.getDefaultLegendData();
                    return legendData.title = title, legendData.dataPoints = legendDataPoints, legendData.grouped = data.hasDynamicSeries, 
                    legendData;
                }
            }, LineChart.createLabelDataPoints = function(viewModel) {
                for (var labelSettings, currentSeries, xScale = viewModel.xAxisProperties.scale, yScale = viewModel.yAxisProperties.scale, lineshift = viewModel.horizontalOffset, data = viewModel.data, series = data.series, baseLabelSettings = data.dataLabelsSettings, formattersCache = visuals.LabelUtils.createColumnFormatterCacheManager(), isStackedArea = EnumExtensions.hasFlag(viewModel.lineType, 16), labelDataPointGroups = [], isScalar = data.isScalar, _loop_2 = function(seriesIndex, seriesCount) {
                    currentSeries = series[seriesIndex], labelSettings = currentSeries.labelSettings || baseLabelSettings;
                    var densityAtMax = "100" === labelSettings.labelDensity, numberOfLabelsToRender = visuals.LabelUtils.getNumberOfLabelsToRender(viewModel.currentViewport.width, _.parseInt(labelSettings.labelDensity), this_1.minimumLabelsToRender, visuals.MinMaxLabelDataPointSorter.estimatedLabelWidth), maxNumberOfLabels = !densityAtMax && isScalar ? numberOfLabelsToRender : currentSeries.data.length;
                    if (!labelSettings.show) return labelDataPointGroups[seriesIndex] = {
                        labelDataPoints: [],
                        maxNumberOfLabels: 0
                    }, "continue";
                    var labelUnitsAndPrecision = visuals.LabelUtils.getLabelUnitAndPrecisionForAxis(viewModel.yAxisProperties, labelSettings), dataPoints = currentSeries.data, seriesLabelDataPoints = [], createLabelDataPoint = function(series, dataPoint, categoryIndex) {
                        var parentShape, formatString = dataPoint.labelFormatString, formatter = formattersCache.getOrCreate(formatString, labelSettings, labelUnitsAndPrecision.units, labelUnitsAndPrecision.getPrecision(!!formatString, series.type)), text = visuals.LabelUtils.getLabelFormattedText(formatter.format(dataPoint.value)), fontProperties = labelSettings ? labelSettings.fontProperties : visuals.LabelUtils.defaultFontProperties, properties = visuals.FontProperties.toTextProperties(fontProperties, text), textWidth = powerbi.TextMeasurementService.measureSvgTextWidth(properties) + visuals.LabelUtils.LabelDensityPadding, textHeight = powerbi.TextMeasurementService.estimateSvgTextHeight(properties, !0), isParentRect = !1;
                        if (isStackedArea) {
                            var bottomPos = Math.max(dataPoint.stackedValue - dataPoint.value, yScale.domain()[0]), areaWidth = viewModel.currentViewport.width;
                            parentShape = {
                                rect: {
                                    left: xScale(LineChart.getXValue(dataPoint, isScalar)) - areaWidth / 2,
                                    top: yScale(Math.max(dataPoint.stackedValue, dataPoint.stackedValue - dataPoint.value)),
                                    width: areaWidth,
                                    height: Math.abs(yScale(dataPoint.stackedValue) - yScale(bottomPos))
                                },
                                orientation: dataPoint.value >= 0 ? 1 : 2,
                                validPositions: LineChart.validStackedLabelPositions
                            }, isParentRect = !0;
                        } else {
                            var markerProperties = series.lineStyle.markerProperties;
                            parentShape = {
                                point: {
                                    x: xScale(LineChart.getXValue(dataPoint, isScalar)) + lineshift,
                                    y: yScale(dataPoint.value)
                                },
                                radius: markerProperties.showMarker ? markerProperties.size : 0,
                                validPositions: densityAtMax ? [ 1 ] : LineChart.getValidLabelPositions(currentSeries, categoryIndex)
                            };
                        }
                        var labelDataPoint = {
                            isPreferred: !1,
                            text: text,
                            textSize: {
                                width: textWidth,
                                height: textHeight
                            },
                            outsideFill: fontProperties.color ? fontProperties.color : visuals.LabelUtils.defaultLabelColor,
                            insideFill: fontProperties.color && isStackedArea ? fontProperties.color : visuals.LabelUtils.defaultInsideLabelColor,
                            parentType: isParentRect ? 1 : 0,
                            parentShape: parentShape,
                            fontProperties: fontProperties,
                            identity: dataPoint.identity,
                            key: dataPoint.key
                        };
                        return labelDataPoint;
                    };
                    if (!_.isEmpty(dataPoints)) for (var categoryIndex = 0, categoryCount = dataPoints.length; categoryIndex < categoryCount; categoryIndex++) {
                        var dataPoint = dataPoints[categoryIndex];
                        if (null != dataPoint && null != dataPoint.value) {
                            var labelDataPoint = createLabelDataPoint(currentSeries, dataPoint, categoryIndex);
                            seriesLabelDataPoints.push(labelDataPoint);
                        }
                    }
                    labelDataPointGroups[seriesIndex] = {
                        labelDataPoints: seriesLabelDataPoints,
                        maxNumberOfLabels: maxNumberOfLabels
                    };
                }, this_1 = this, seriesIndex = 0, seriesCount = series.length; seriesIndex < seriesCount; seriesIndex++) _loop_2(seriesIndex, seriesCount);
                var sorter = new visuals.MinMaxLabelDataPointSorter({
                    unsortedLabelDataPointGroups: labelDataPointGroups,
                    series: series,
                    viewport: viewModel.currentViewport,
                    yAxisProperties: viewModel.yAxisProperties
                });
                return sorter.getSortedDataLabels();
            }, LineChart.prototype.adjustPathXCoordinate = function(x) {
                var xScale = this.scaleDetector.getScale().x;
                return x -= powerbi.Double.equalWithPrecision(xScale, 1, 1e-5) ? this.pathXAdjustment : this.pathXAdjustment * xScale;
            }, LineChart.getValidLabelPositions = function(series, categoryIndex) {
                var data = series.data, dataLength = data.length, isLastPoint = categoryIndex === dataLength - 1, isFirstPoint = 0 === categoryIndex, currentValue = data[categoryIndex].value, previousValue = data[categoryIndex - 1] && data[categoryIndex - 1].value, nextValue = data[categoryIndex + 1] && data[categoryIndex + 1].value, previousRelativePosition = 1, nextRelativePosition = 1;
                if (null == previousValue ? previousRelativePosition = 0 : previousValue > currentValue ? previousRelativePosition = 3 : previousValue < currentValue && (previousRelativePosition = 2), 
                null === nextValue ? nextRelativePosition = 0 : nextValue > currentValue ? nextRelativePosition = 3 : nextValue < currentValue && (nextRelativePosition = 2), 
                isFirstPoint) switch (nextRelativePosition) {
                  case 3:
                    return [ 2, 1 ];

                  default:
                    return [ 1, 2 ];
                }
                if (isLastPoint) switch (previousRelativePosition) {
                  case 3:
                    return [ 2, 1 ];

                  default:
                    return [ 1, 2 ];
                }
                switch (previousRelativePosition) {
                  case 0:
                    switch (nextRelativePosition) {
                      case 0:
                        return [ 1, 2, 8, 4 ];

                      case 1:
                        return [ 1, 2, 4, 8 ];

                      case 3:
                        return [ 2, 1, 4, 8 ];

                      case 2:
                        return [ 1, 2, 4, 8 ];
                    }

                  case 1:
                    switch (nextRelativePosition) {
                      case 0:
                        return [ 1, 2, 8, 4 ];

                      case 1:
                        return [ 1, 2, 8, 4 ];

                      case 3:
                        return [ 2, 1, 8, 4 ];

                      case 2:
                        return [ 1, 2, 8, 4 ];
                    }

                  case 3:
                    switch (nextRelativePosition) {
                      case 0:
                        return [ 2, 1, 8, 4 ];

                      case 1:
                        return [ 2, 1, 4, 8 ];

                      case 3:
                        return [ 2, 1, 8, 4 ];

                      case 2:
                        return [ 1, 2, 8, 4 ];
                    }

                  case 2:
                    switch (nextRelativePosition) {
                      case 0:
                        return [ 1, 2, 8, 4 ];

                      case 1:
                        return [ 1, 2, 4, 8 ];

                      case 3:
                        return [ 1, 2, 8, 4 ];

                      case 2:
                        return [ 1, 2, 8, 4 ];
                    }
                }
            }, LineChart.prototype.getCartesianVisualCapabilities = function() {
                return {
                    supportsHierarchicalCategoryAxis: !0
                };
            }, LineChart.prototype.getStaticSeriesRole = function() {
                return this.isComboChart ? "Y2" : "Y";
            }, LineChart.prototype.calculateCustomLegend = function() {
                if (!this.dataView) return visuals.Legend.getDefaultLegendData();
                var data = this.data, legendData = visuals.Legend.buildSeriesLegendData({
                    dataView: this.dataView,
                    allowLegendWithNoSeries: this.isComboChart,
                    showByDefault: !0,
                    staticSeriesRole: this.getStaticSeriesRole(),
                    style: this.style,
                    ignoreDefaultColor: this.isComboChart,
                    ignoreDefaultCategoryColor: !0,
                    lineAndMarkerOptions: {
                        renderMarkers: !data.isScalar,
                        renderLineStyle: !0,
                        legendMarkerRendering: data.legendMarkerRendering,
                        matchSeriesColor: data.matchLineColor,
                        defaultMarkerShape: data.defaultToCircle ? visuals.markerShape.circle : visuals.markerShape.longDash
                    }
                });
                return legendData;
            }, LineChart.prototype.enumerateCustomLegend = function(options) {
                var data = this.data, legendMarker = data.legendMarkerRendering, modifiedOptions = __assign({}, options, {
                    legendMarkerRendering: legendMarker,
                    matchLineColor: legendMarker === visuals.legendMarkerRendering.markerOnly ? data.matchLineColor : void 0,
                    defaultToCircle: legendMarker === visuals.legendMarkerRendering.markerOnly ? data.defaultToCircle : void 0
                });
                visuals.Legend.enumerate(this.lineStylesEnabled ? modifiedOptions : options);
            }, LineChart.ClassName = "lineChart", LineChart.MainGraphicsContextClassName = "mainGraphicsContext", 
            LineChart.CategorySelector = createClassAndSelector("cat"), LineChart.CategoryValuePoint = createClassAndSelector("dot"), 
            LineChart.CategoryPointSelector = createClassAndSelector("point"), LineChart.CategoryAreaSelector = createClassAndSelector("catArea"), 
            LineChart.HoverLineCircleDot = createClassAndSelector("circle-item"), LineChart.LineClassSelector = createClassAndSelector("line"), 
            LineChart.MarkerLineClassSelector = createClassAndSelector("marker-line"), LineChart.InteractivityLineClassSelector = createClassAndSelector("interactivity-line"), 
            LineChart.PointRadiusExtra = 4, LineChart.CircleRadiusExtra = 3, LineChart.TooltipCircleRadiusExtra = 2, 
            LineChart.PathElementName = "path", LineChart.CircleElementName = "circle", LineChart.CircleClassName = "selection-circle", 
            LineChart.LineElementName = "line", LineChart.ScalarOuterPadding = 10, LineChart.interactivityStrokeWidth = 10, 
            LineChart.minimumLabelsToRender = 4, LineChart.AreaFillOpacity = .4, LineChart.DimmedAreaFillOpacity = .2, 
            LineChart.defaultLineStrokeWidth = 2, LineChart.validStackedLabelPositions = [ 1, 4, 2 ], 
            LineChart;
        }();
        visuals.LineChart = LineChart;
        var LineChartTooltipService = function() {
            function LineChartTooltipService(tooltipService, mainGraphicsSVG, supportsHoverLineTooltip) {
                this.tooltipService = tooltipService, this.mainGraphicsSVG = mainGraphicsSVG, supportsHoverLineTooltip && (this.tooltipOverlay = mainGraphicsSVG.append("rect").classed("tooltip-overlay", !0).style("opacity", visuals.SVGUtil.AlmostZero)), 
                this.showHoverLine = !1;
            }
            return Object.defineProperty(LineChartTooltipService.prototype, "usingHoverLine", {
                get: function() {
                    return this.showHoverLine;
                },
                enumerable: !0,
                configurable: !0
            }), LineChartTooltipService.prototype.getTooltipOverlayElement = function() {
                if (this.showHoverLine) return this.tooltipOverlay;
            }, LineChartTooltipService.prototype.applyTooltips = function(context, plotAreaHelper, tooltipInteractivity) {
                !this.tooltipOverlay || context.binnedLineSamplingApplied && context.hasDynamicSeries ? this.applyPointTooltip(context, plotAreaHelper, tooltipInteractivity) : this.applyHoverLineTooltip(context, plotAreaHelper, tooltipInteractivity);
            }, LineChartTooltipService.prototype.applyHoverLineTooltip = function(context, plotAreaHelper, tooltipInteractivity) {
                if (this.tooltipOverlay) {
                    this.showHoverLine || this.removePointTooltip(context), this.tooltipOverlay.attr({
                        x: 0,
                        width: context.width,
                        height: context.height
                    });
                    var seriesTooltipApplier = function(args) {
                        var pointX = args.elementCoordinates[0], index = plotAreaHelper.getCategoryIndexFromTooltipEvent(args, pointX), hoverLineData = tooltipInteractivity.getHoverLineDataForCategory(index);
                        return LineChart.getSeriesTooltipInfo(hoverLineData);
                    };
                    this.tooltipService.addTooltip(this.mainGraphicsSVG, seriesTooltipApplier, function(args) {
                        return LineChartTooltipService.getIdentityForTooltipEvent(args.data);
                    }, !0), this.mainGraphicsSVG.on("mouseout.hoverline", function() {
                        return tooltipInteractivity.clearHoverLine();
                    }), this.mainGraphicsSVG.on("touchmove.hoverline", function() {
                        return tooltipInteractivity.clearHoverLine();
                    }), this.showHoverLine = !0;
                }
            }, LineChartTooltipService.prototype.removeHoverLineTooltip = function(context) {
                this.tooltipService.removeTooltips(this.mainGraphicsSVG), this.mainGraphicsSVG.on(".hoverline", null), 
                this.showHoverLine = !1;
            }, LineChartTooltipService.prototype.applyPointTooltip = function(context, plotAreaHelper, tooltipInteractivity) {
                this.showHoverLine && this.removeHoverLineTooltip(context);
                var seriesTooltipApplier = function(args) {
                    var pointX = args.elementCoordinates[0];
                    return plotAreaHelper.getTooltipInfoForPoint(args, pointX);
                };
                this.tooltipService.addTooltip(context.interactivityLines, seriesTooltipApplier, function(args) {
                    return args.data && args.data.identity;
                }, !0), this.tooltipService.addTooltip(context.dots, function(args) {
                    return args.data && args.data.tooltipInfo;
                }, function(args) {
                    return args.data && args.data.identity;
                }, !0), context.explicitDots && this.tooltipService.addTooltip(context.explicitDots, function(args) {
                    return args.data && args.data.tooltipInfo;
                }, function(args) {
                    return args.data && args.data.identity;
                }, !0), this.showHoverLine = !1;
            }, LineChartTooltipService.prototype.removePointTooltip = function(context) {
                context.interactivityLines && this.tooltipService.removeTooltips(context.interactivityLines), 
                context.dots && this.tooltipService.removeTooltips(context.dots), context.explicitDots && this.tooltipService.removeTooltips(context.explicitDots);
            }, LineChartTooltipService.getIdentityForTooltipEvent = function(data) {
                if (data) return LineChart.isForecastPoint(data) ? void 0 : data.identity;
            }, LineChartTooltipService;
        }();
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        function lineSelection(options, selectionHandler, pointX, d, index) {
            var categoryIndex = options.getCategoryIndex(d, pointX, !0), position = visuals.InteractivityUtils.getPositionOfLastInputEvent(), dataPoint = _.find(d.data, function(dataPoint) {
                return dataPoint && dataPoint.categoryIndex === categoryIndex;
            });
            dataPoint ? selectionHandler.handleSelection(dataPoint, d3.event.ctrlKey, position) : selectionHandler.handleSelection({
                selected: d.selected,
                identity: d.identity,
                specificIdentity: options.categoryIdentities[categoryIndex]
            }, d3.event.ctrlKey, position);
        }
        function lineContextMenu(options, selectionHandler, pointX, d, index) {
            if (!d3.event.ctrlKey) {
                d3.event.preventDefault();
                var position = visuals.InteractivityUtils.getPositionOfLastInputEvent(), categoryIndex = options.getCategoryIndex(d, pointX, !0), dataPoint = _.find(d.data, function(dataPoint) {
                    return dataPoint && dataPoint.categoryIndex === categoryIndex;
                });
                dataPoint ? selectionHandler.handleContextMenu(dataPoint, position) : selectionHandler.handleContextMenu({
                    selected: d.selected,
                    identity: d.identity,
                    specificIdentity: options.categoryIdentities[categoryIndex]
                }, position);
            }
        }
        var LineChartWebBehavior = function() {
            function LineChartWebBehavior() {}
            return LineChartWebBehavior.prototype.bindEvents = function(options, selectionHandler) {
                var _this = this;
                this.lines = options.lines, this.markerPaths = options.markerPaths;
                var interactivityLines = options.interactivityLines, dots = this.dots = options.dots;
                this.areas = options.areas;
                var tooltipOverlay = this.tooltipOverlay = options.tooltipOverlay, getPointX = function(rootNode) {
                    return _this.getPointX(rootNode);
                };
                interactivityLines.on("click", function(d, index) {
                    lineSelection(options, selectionHandler, getPointX(this), d, index);
                }), interactivityLines.on("contextmenu", function(d, index) {
                    lineContextMenu(options, selectionHandler, getPointX(this), d, index);
                }), visuals.InteractivityUtils.registerStandardInteractivityHandlers(dots, selectionHandler), 
                tooltipOverlay && (_.isEmpty(options.categoryIdentities) ? tooltipOverlay.on("click", function() {
                    d3.event.ctrlKey || selectionHandler.handleClearSelection();
                }) : (tooltipOverlay.on("click", function() {
                    var categoryIndex = options.getCategoryIndex(void 0, getPointX(this), !1), position = visuals.InteractivityUtils.getPositionOfLastInputEvent();
                    selectionHandler.handleSelection({
                        selected: !1,
                        identity: void 0,
                        specificIdentity: options.categoryIdentities[categoryIndex]
                    }, d3.event.ctrlKey, position);
                }), tooltipOverlay.on("contextmenu", function() {
                    if (!d3.event.ctrlKey) {
                        d3.event.preventDefault();
                        var position = visuals.InteractivityUtils.getPositionOfLastInputEvent(), categoryIndex = options.getCategoryIndex(void 0, getPointX(this), !1);
                        selectionHandler.handleContextMenu({
                            selected: !1,
                            identity: void 0,
                            specificIdentity: options.categoryIdentities[categoryIndex]
                        }, position);
                    }
                })));
            }, LineChartWebBehavior.prototype.renderSelection = function(hasSelection) {
                this.lines.style("stroke-opacity", function(d) {
                    return visuals.ColumnUtil.getFillOpacity(d.selected, !1, hasSelection, !1);
                }), this.dots.style("fill-opacity", function(d) {
                    return d.lineStyle.markerProperties.showMarker ? 0 : visuals.ColumnUtil.getFillOpacity(d.selected, !1, hasSelection, !1);
                }), this.markerPaths && this.markerPaths.style("opacity", function(d) {
                    return visuals.ColumnUtil.getFillOpacity(d.selected, !1, hasSelection, !1);
                }), this.areas && this.areas.style("fill-opacity", function(d) {
                    return hasSelection && !d.selected ? visuals.LineChart.DimmedAreaFillOpacity : visuals.LineChart.AreaFillOpacity;
                });
            }, LineChartWebBehavior.prototype.getPointX = function(rootNode) {
                for (var s, e = d3.event; s = e.sourceEvent; ) e = s;
                var rect = rootNode.getBoundingClientRect();
                return e.clientX - rect.left - rootNode.clientLeft;
            }, LineChartWebBehavior;
        }();
        visuals.LineChartWebBehavior = LineChartWebBehavior;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var createClassAndSelector = jsCommon.CssConstants.createClassAndSelector, createDataViewScopeIdentity = powerbi.data.createDataViewScopeIdentity, DataViewConcatenateCategoricalColumns = powerbi.data.DataViewConcatenateCategoricalColumns, DataViewMatrixUtils = powerbi.data.DataViewMatrixUtils, SQExprBuilder = powerbi.data.SQExprBuilder, DisableDragAttribute = "drag-resize-disabled", PlayAxis = function() {
            function PlayAxis(options) {
                options && (this.interactivityService = options.interactivityService);
            }
            return PlayAxis.prototype.init = function(options) {
                var _this = this;
                this.element = options.element, this.svg = options.svg, this.host = options.host, 
                this.isMobileChart = options.interactivity && options.interactivity.isInteractiveLegend, 
                this.interactivityService && (this.playControl = new PlayControl(this.element, function(frameIndex) {
                    return _this.moveToFrameAndRender(frameIndex);
                }, this.isMobileChart), this.playControl.onPlay(function() {
                    return _this.play();
                }));
            }, PlayAxis.prototype.setData = function(dataView, visualConverter) {
                if (dataView) {
                    if (this.ridiculousFlagForPersistProperties && dataView.metadata) return this.ridiculousFlagForPersistProperties = !1, 
                    this.playData;
                    dataView.matrix || dataView.categorical ? this.playData = PlayChart.converter(dataView, visualConverter) : this.playData = PlayChart.getDefaultPlayData();
                } else this.playData = PlayChart.getDefaultPlayData();
                return this.lastViewport = void 0, this.playData;
            }, PlayAxis.prototype.render = function(suppressAnimations, viewModel, viewport, margin) {
                var playData = this.playData, resized = !this.lastViewport || this.lastViewport.height !== viewport.height || this.lastViewport.width !== viewport.width;
                if (this.lastViewport = viewport, resized && this.stop(), playData) {
                    var playViewModel = {
                        data: this.playData,
                        viewModel: viewModel,
                        viewport: viewport
                    }, hasSelection = !1;
                    if (this.interactivityService) {
                        var data_1 = playData.currentViewModel;
                        this.interactivityService.applySelectionStateToData(data_1.dataPoints), hasSelection = this.interactivityService.hasSelection();
                    }
                    this.updateCallout(viewport, margin), this.playControl && resized && this.playControl.rebuild(playData, viewport);
                    var allDataPoints = playData.allViewModels.map(function(vm) {
                        return vm.dataPoints;
                    }), flatAllDataPoints = _.flatten(allDataPoints);
                    return {
                        allDataPoints: flatAllDataPoints,
                        viewModel: playViewModel
                    };
                }
            }, PlayAxis.prototype.updateCallout = function(viewport, margin) {
                var playData = this.playData, frameData = playData.frameData, currentFrameIndex = playData.currentFrameIndex, height = viewport.height, plotAreaHeight = height - margin.top - margin.bottom, width = viewport.width, plotAreaWidth = width - margin.left - margin.right, textHeight = 0, calloutDimension = Math.min(height, 1.3 * width), fontSize = Math.max(12, Math.round(calloutDimension / 7));
                fontSize = Math.min(fontSize, 70);
                var calloutData = [];
                if (currentFrameIndex < frameData.length && currentFrameIndex >= 0) {
                    var textProperties = {
                        fontSize: jsCommon.PixelConverter.toString(fontSize),
                        text: frameData[currentFrameIndex].text || "",
                        fontFamily: visuals.Font.Family.regular.css
                    };
                    if (textHeight = powerbi.TextMeasurementService.estimateSvgTextHeight(textProperties) - powerbi.TextMeasurementService.estimateSvgTextBaselineDelta(textProperties), 
                    textHeight < plotAreaHeight) {
                        var maxTextWidth = plotAreaWidth - 2 * PlayAxis.calloutOffsetMultiplier * textHeight, calloutText = powerbi.TextMeasurementService.getTailoredTextOrDefault(textProperties, maxTextWidth);
                        calloutData = [ calloutText ];
                    }
                }
                var callout = this.svg.selectAll(PlayAxis.PlayCallout.selector).data(calloutData);
                callout.enter().append("text").classed(PlayAxis.PlayCallout.class, !0), callout.text(function(d) {
                    return d;
                }).attr({
                    x: plotAreaWidth - PlayAxis.calloutOffsetMultiplier * textHeight,
                    y: function() {
                        return textHeight;
                    }
                }).style({
                    "font-size": fontSize + "px",
                    "text-anchor": "end"
                }), callout.exit().remove();
            }, PlayAxis.prototype.play = function() {
                var playData = this.playData;
                if (this.isPlaying) this.stop(); else if (this.playControl) {
                    this.isPlaying = !0, this.playControl.play();
                    var indexToShow = this.playControl.getCurrentIndex();
                    if (null == indexToShow) return;
                    indexToShow = Math.round(indexToShow), indexToShow >= playData.allViewModels.length - 1 ? playData.currentFrameIndex = -1 : playData.currentFrameIndex = indexToShow - 1, 
                    this.playNextFrame(playData);
                }
            }, PlayAxis.prototype.playNextFrame = function(playData, startFrame, endFrame) {
                var _this = this;
                if (!this.isPlaying) return void this.stop();
                var nextFrame = playData.currentFrameIndex + 1;
                if (null != startFrame && null != endFrame && (nextFrame = Math.abs(endFrame - startFrame + 1), 
                startFrame = nextFrame), nextFrame < playData.allViewModels.length && nextFrame > -1) {
                    var tooltipService = this.host.tooltips();
                    tooltipService && tooltipService.hide({
                        immediately: !0,
                        isTouchEvent: !1
                    }), playData.currentFrameIndex = nextFrame, playData.currentViewModel = playData.allViewModels[nextFrame], 
                    this.renderDelegate(playData.currentViewModel), this.playControl.setFrame(nextFrame), 
                    nextFrame < playData.allViewModels.length && window.setTimeout(function() {
                        _this.playNextFrame(playData, startFrame, endFrame);
                    }, PlayChart.FrameStepDuration);
                } else this.stop();
            }, PlayAxis.prototype.stop = function() {
                this.playControl && this.playControl.pause(), this.isPlaying = !1;
            }, PlayAxis.prototype.remove = function() {
                this.playControl && this.playControl.remove(), d3.selectAll(PlayAxis.PlayCallout.selector).remove();
            }, PlayAxis.prototype.setRenderFunction = function(fn) {
                this.renderDelegate = fn;
            }, PlayAxis.prototype.getCartesianExtents = function(existingExtents, getExtents) {
                return !this.playData || _.isEmpty(this.playData.allViewModels) || _.isEmpty(this.playData.frameData) ? existingExtents : PlayChart.getMinMaxForAllFrames(this.playData, getExtents) || existingExtents;
            }, PlayAxis.prototype.setPlayControlPosition = function(playControlLayout) {
                if (this.playControl) {
                    var container = this.playControl.getContainer();
                    container.css("left", playControlLayout.left ? playControlLayout.left + "px" : ""), 
                    container.css("top", playControlLayout.top ? playControlLayout.top + "px" : "");
                }
            }, PlayAxis.prototype.moveToFrameAndRender = function(frameIndex) {
                var playData = this.playData;
                if (this.isPlaying = !0, playData && frameIndex >= 0 && frameIndex < playData.allViewModels.length && frameIndex !== playData.currentFrameIndex) {
                    playData.currentFrameIndex = frameIndex;
                    var data_2 = playData.allViewModels[frameIndex];
                    playData.currentViewModel = data_2, this.renderDelegate(data_2);
                }
                this.isPlaying = !1;
            }, PlayAxis.prototype.isCurrentlyPlaying = function() {
                return this.isPlaying;
            }, PlayAxis.PlayCallout = createClassAndSelector("play-callout"), PlayAxis.calloutOffsetMultiplier = .3, 
            PlayAxis;
        }();
        visuals.PlayAxis = PlayAxis;
        var PlayChart, PlayControl = function() {
            function PlayControl(element, renderDelegate, isMobileChart) {
                this.isMobileChart = isMobileChart, this.createSliderDOM(element), this.renderDelegate = renderDelegate;
            }
            return PlayControl.prototype.getContainer = function() {
                return this.playAxisContainer;
            }, PlayControl.prototype.remove = function() {
                this.playAxisContainer && this.playAxisContainer.remove();
            }, PlayControl.prototype.pause = function() {
                this.playButton.removeClass("pause").addClass("play");
            }, PlayControl.prototype.play = function() {
                this.playButton.removeClass("play").addClass("pause");
            }, PlayControl.prototype.getCurrentIndex = function() {
                if (this.noUiSlider) return Math.round(this.noUiSlider.get());
            }, PlayControl.prototype.onPlay = function(handler) {
                this.playButtonCircle.off("click"), this.playButtonCircle.on("click", handler);
            }, PlayControl.prototype.setFrame = function(frameIndex) {
                this.noUiSlider.set([ frameIndex ]);
            }, PlayControl.prototype.rebuild = function(playData, viewport) {
                var _this = this, slider = this.slider;
                this.playAxisContainer.css("width", viewport.width), this.noUiSlider && this.noUiSlider.destroy();
                var labelData = playData.labelData, sliderSize = PlayControl.calucalateSliderSize(labelData, viewport.width), container = this.getContainer();
                sliderSize.marginLeft > PlayControl.SliderMarginLeft && (container.css("padding-left", sliderSize.marginLeft - PlayControl.SliderMarginLeft + "px"), 
                container.css("box-sizing", "border-box"));
                var skipStep = this.updateSliderControl(playData, sliderSize.width), width = PlayControl.adjustWidthRegardingLastItem(labelData, skipStep, sliderSize.width);
                this.slider.css("width", width + "px"), this.noUiSlider.on("slide", function() {
                    var indexToShow = _this.getCurrentIndex();
                    _this.renderDelegate(indexToShow);
                });
                var nextLabelIndex = 0;
                $(".noUi-value", slider).each(function(idx, elem) {
                    var actualWidth = labelData.labelInfo[nextLabelIndex].labelWidth;
                    $(elem).width(actualWidth), $(elem).css("margin-left", -actualWidth / 2 + "px"), 
                    nextLabelIndex += skipStep;
                });
            }, PlayControl.prototype.updateSliderControl = function(playData, sliderWidth) {
                var labelData = playData.labelData, sliderElement = this.slider.get(0), numFrames = playData.frameData.length, options = {
                    start: 0 === numFrames ? 0 : playData.currentFrameIndex,
                    step: 1,
                    range: {
                        min: 0,
                        max: 0 === numFrames ? 0 : numFrames - 1
                    }
                }, pipOptions = null, skipMode = 0;
                if (numFrames > 0) {
                    var filterPipLabels = PlayControl.createPipsFilterFn(playData, sliderWidth, labelData);
                    skipMode = filterPipLabels.skipStep, pipOptions = {
                        mode: "steps",
                        density: Math.ceil(100 / numFrames),
                        format: {
                            to: function(index) {
                                return playData.frameData[index].escapedText;
                            },
                            from: function(value) {
                                return playData.frameData.indexOf(value);
                            }
                        },
                        filter: filterPipLabels.filter
                    };
                }
                return options.pips = pipOptions, noUiSlider.create(sliderElement, options), this.noUiSlider = sliderElement.noUiSlider, 
                skipMode;
            }, PlayControl.createPipsFilterFn = function(playData, sliderWidth, labelData) {
                var maxLabelWidth = _.max(_.map(labelData.labelInfo, function(l) {
                    return l.labelWidth;
                })), pipSize = 1, skipMode = 1, maxAllowedLabelWidth = playData.frameData.length > 1 ? sliderWidth / (playData.frameData.length - 1) : sliderWidth, widthRatio = maxLabelWidth / maxAllowedLabelWidth;
                widthRatio > 1.25 ? (skipMode = Math.ceil(widthRatio), pipSize = 2) : (widthRatio > 1 || labelData.anyWordBreaks) && (pipSize = 2);
                var filterPipLabels = function(index, type) {
                    return index % skipMode === 0 ? pipSize : 0;
                };
                return {
                    filter: filterPipLabels,
                    skipStep: skipMode
                };
            }, PlayControl.adjustWidthRegardingLastItem = function(labelData, skipMode, sliderWidth) {
                if (_.isEmpty(labelData.labelInfo)) return sliderWidth;
                var labelLenth = labelData.labelInfo.length, lastVisibleItemIndex = Math.floor((labelLenth - 1) / skipMode) * skipMode, distanceToEnd = sliderWidth + PlayControl.SliderMarginRight - sliderWidth / labelLenth * (lastVisibleItemIndex + 1), lastItemWidth = labelData.labelInfo[lastVisibleItemIndex].labelWidth, requiredWidth = lastItemWidth / 2 - distanceToEnd;
                if (requiredWidth > 0) {
                    var maxMargin = PlayControl.SliderMaxMargin - PlayControl.SliderMarginRight;
                    return requiredWidth = requiredWidth > maxMargin ? maxMargin : requiredWidth, sliderWidth - requiredWidth;
                }
                return sliderWidth;
            }, PlayControl.prototype.createSliderDOM = function(element) {
                this.playAxisContainer = $('<div class="play-axis-container"></div>').appendTo(element).css("height", PlayControl.PlayControlHeight + "px"), 
                this.playButtonCircle = $('<div class="button-container"></div>').appendTo(this.playAxisContainer), 
                this.isMobileChart && this.playButtonCircle.addClass("mobile-button-container"), 
                this.playButton = $('<div class="play"></div>').appendTo(this.playButtonCircle), 
                this.slider = $('<div class="sliders"></div>').attr(DisableDragAttribute, "true").appendTo(this.playAxisContainer);
            }, PlayControl.calucalateSliderSize = function(labelData, viewportWidth) {
                var leftMargin = 0;
                _.isEmpty(labelData.labelInfo) || (leftMargin = _.first(labelData.labelInfo).labelWidth / 2);
                var sliderLeftMargin = Math.max(leftMargin, PlayControl.SliderMarginLeft);
                sliderLeftMargin = Math.min(PlayControl.SliderMaxMargin, sliderLeftMargin);
                var sliderWidth = Math.max(viewportWidth - sliderLeftMargin - PlayControl.SliderMarginRight, 1);
                return {
                    width: sliderWidth,
                    marginLeft: sliderLeftMargin
                };
            }, PlayControl.SliderMarginLeft = 44, PlayControl.SliderMarginRight = 20, PlayControl.SliderMaxMargin = 100, 
            PlayControl.PlayControlHeight = 80, PlayControl;
        }();
        !function(PlayChart) {
            function convertMatrixToCategorical(sourceDataView, frame) {
                var matrix = sourceDataView.matrix, categorical = {
                    categories: [],
                    values: powerbi.data.DataViewTransform.createValueColumns()
                };
                if (_.isEmpty(matrix.columns.levels) || matrix.rows.levels.length < 2 && matrix.columns.levels.length < 2) return (_a = categorical.values).push.apply(_a, createEmptyValueColumns(matrix.valueSources)), 
                {
                    metadata: sourceDataView.metadata,
                    categorical: categorical
                };
                for (var CategoryRowLevelsStartingIndex = 1, categories = [], i_2 = CategoryRowLevelsStartingIndex, ilen = matrix.rows.levels.length; i_2 < ilen; i_2++) {
                    var sourceColumn = matrix.rows.levels[i_2].sources[0];
                    categories.push({
                        source: sourceColumn,
                        values: [],
                        identity: [],
                        objects: void 0
                    });
                }
                var hasRowChildren = !_.isEmpty(matrix.rows.root.children), hasColChildren = !_.isEmpty(matrix.columns.root.children), hasSeries = matrix.columns.levels.length > 1 && hasColChildren, hasPlayAndCategory = matrix.rows.levels.length > 1 && hasRowChildren;
                if (hasSeries && !hasPlayAndCategory) {
                    categorical.categories = void 0;
                    var node = matrix.columns.root;
                    categorical.values.source = matrix.columns.levels[0].sources[0];
                    for (var columnLength_1 = matrix.valueSources.length, i_3 = 0, len_1 = node.children.length; i_3 < len_1; i_3++) {
                        var columnNode = node.children[i_3];
                        if (!columnNode.isSubtotal) for (var j = 0; j < columnLength_1; j++) {
                            var source = _.create(matrix.valueSources[j], {
                                groupName: void 0 === columnNode.value ? null : columnNode.value
                            }), dataViewColumn = {
                                identity: columnNode.identity,
                                values: [],
                                source: source
                            };
                            categorical.values.push(dataViewColumn);
                        }
                    }
                    for (var playFrameNode = matrix.rows.root.children[frame], matrixIntersectionValues = playFrameNode.values, i = 0, len = node.children.length; i < len; i++) if (!node.children[i].isSubtotal) for (var j = 0; j < columnLength_1; j++) categorical.values[i * columnLength_1 + j].values.push(matrixIntersectionValues[i * columnLength_1 + j].value);
                } else if (hasSeries && hasRowChildren) {
                    var playFrameNode = matrix.rows.root.children[frame];
                    DataViewMatrixUtils.forEachLeafNode(playFrameNode.children, function(categoryGroupLeafNode, index, categoryHierarchicalGroupNodes) {
                        categoryGroupLeafNode.isSubtotal || addMatrixHierarchicalGroupToCategories(categoryHierarchicalGroupNodes, categories);
                    }), categorical.categories = categories, categorical.values.source = matrix.columns.levels[0].sources[0];
                    for (var nodeQueue = [], columnNode = matrix.columns.root, seriesIndex_1 = -1; columnNode; ) if (!columnNode.isSubtotal) {
                        if (columnNode.children && columnNode.children[0].children) for (var j = 0, jlen = columnNode.children.length; j < jlen; j++) columnNode.children[j].isSubtotal || nodeQueue.push(columnNode.children[j]); else if (columnNode.children && playFrameNode.children) {
                            for (var columnLength = columnNode.children.length, j = 0; j < columnLength; j++) {
                                var source = _.create(matrix.valueSources[j], {
                                    groupName: columnNode.value
                                }), dataViewColumn = {
                                    identity: columnNode.identity,
                                    values: [],
                                    source: source
                                };
                                categorical.values.push(dataViewColumn);
                            }
                            DataViewMatrixUtils.forEachLeafNode(playFrameNode.children, function(leafNode) {
                                if (!leafNode.isSubtotal) for (var j = 0; j < columnLength; j++) categorical.values[seriesIndex_1 * columnLength + j].values.push(leafNode.values[seriesIndex_1 * columnLength + j].value);
                            });
                        }
                        nodeQueue.length > 0 ? (columnNode = nodeQueue[0], nodeQueue = nodeQueue.splice(1), 
                        seriesIndex_1++) : columnNode = void 0;
                    }
                } else if (hasPlayAndCategory) {
                    var playFrameNode = matrix.rows.root.children[frame], measureLength_1 = matrix.valueSources.length;
                    (_b = categorical.values).push.apply(_b, createEmptyValueColumns(matrix.valueSources)), 
                    DataViewMatrixUtils.forEachLeafNode(playFrameNode.children, function(categoryGroupLeafNode, index, categoryHierarchicalGroupNodes) {
                        if (!categoryGroupLeafNode.isSubtotal) {
                            addMatrixHierarchicalGroupToCategories(categoryHierarchicalGroupNodes, categories);
                            for (var j = 0; j < measureLength_1; j++) categorical.values[j].values.push(categoryGroupLeafNode.values[j].value);
                        }
                    }), categorical.categories = categories;
                }
                return DataViewConcatenateCategoricalColumns.applyToPlayChartCategorical(sourceDataView.metadata, visuals.scatterChartObjectDescriptors, "Category", categorical);
                var _a, _b;
            }
            function createEmptyValueColumns(metadataColumns) {
                return _.isEmpty(metadataColumns) ? [] : _.map(metadataColumns, function(metadataColumn) {
                    return {
                        identity: void 0,
                        values: [],
                        source: metadataColumn
                    };
                });
            }
            function addMatrixHierarchicalGroupToCategories(sourceCategoryHierarchicalGroupNodes, destinationCategories) {
                var identity = sourceCategoryHierarchicalGroupNodes[0].identity;
                if (sourceCategoryHierarchicalGroupNodes.length > 1) {
                    for (var identityExpr = identity.expr, i = 1, ilen = sourceCategoryHierarchicalGroupNodes.length; i < ilen; i++) {
                        var identityExprToAdd = sourceCategoryHierarchicalGroupNodes[i].identity.expr;
                        identityExpr = SQExprBuilder.and(identityExpr, identityExprToAdd);
                    }
                    identity = createDataViewScopeIdentity(identityExpr);
                }
                for (var j = 0, jlen = destinationCategories.length; j < jlen; j++) {
                    destinationCategories[j].identity.push(identity);
                    var node = sourceCategoryHierarchicalGroupNodes[j];
                    destinationCategories[j].values.push(node.value);
                }
            }
            function getObjectProperties(dataViewMetadata, dataLabelsSettings) {
                var objectProperties = {};
                if (dataViewMetadata && dataViewMetadata.objects) {
                    var objects = dataViewMetadata.objects;
                    objectProperties.currentFrameIndex = powerbi.DataViewObjects.getValue(objects, visuals.scatterChartProps.currentFrameIndex.index, null);
                }
                return objectProperties;
            }
            function converter(dataView, visualConverter) {
                var convertedData, keySourceColumn, dataViewMetadata = dataView.metadata, dataLabelsSettings = visuals.LabelUtils.getDefaultPointLabelSettings(), objectProperties = getObjectProperties(dataViewMetadata, dataLabelsSettings), subtotals = getSubtotals(dataView), allViewModels = [], frameKeys = [], matrixRows = dataView.matrix.rows, rowChildrenLength = matrixRows.root.children ? matrixRows.root.children.length : 0;
                if (dataView.matrix && rowChildrenLength > 0 && !_.isEmpty(matrixRows.levels) && !_.isEmpty(matrixRows.levels[0].sources)) {
                    keySourceColumn = matrixRows.levels[0].sources[0];
                    var formatString = visuals.valueFormatter.getFormatString(keySourceColumn, visuals.scatterChartProps.general.formatString), keyFormatter = void 0;
                    if (keySourceColumn.type.numeric) {
                        var valueRange = Math.abs(matrixRows.root.children[rowChildrenLength - 1].value - matrixRows.root.children[0].value);
                        keyFormatter = visuals.valueFormatter.create({
                            format: formatString,
                            value: valueRange,
                            value2: 0,
                            columnType: keySourceColumn.type
                        });
                    } else keyFormatter = visuals.valueFormatter.createDefaultFormatter(formatString, !0);
                    for (var i = 0, len = rowChildrenLength; i < len; i++) {
                        var key = matrixRows.root.children[i];
                        if (!key.isSubtotal) {
                            var frameLabelText = keyFormatter.format(key.value), frameLabelHtml = $("<div/>").text(frameLabelText).html();
                            frameKeys.push({
                                escapedText: frameLabelHtml,
                                text: frameLabelText
                            });
                            var dataViewCategorical = convertMatrixToCategorical(dataView, i), frameInfo = {
                                label: frameLabelHtml,
                                column: keySourceColumn
                            };
                            convertedData = visualConverter(dataViewCategorical, frameInfo, subtotals), allViewModels.push(convertedData);
                        }
                    }
                } else {
                    var dataViewCategorical = convertMatrixToCategorical(dataView, 0);
                    convertedData = visualConverter(dataViewCategorical, void 0, subtotals), allViewModels.push(convertedData);
                }
                return objectProperties.currentFrameIndex = frameKeys.length - 1, {
                    allViewModels: allViewModels,
                    currentViewModel: convertedData,
                    frameData: frameKeys,
                    currentFrameIndex: objectProperties.currentFrameIndex,
                    labelData: getLabelData(frameKeys, keySourceColumn)
                };
            }
            function getDefaultPlayData() {
                var defaultData = {
                    frameData: [],
                    allViewModels: [],
                    currentFrameIndex: 0,
                    currentViewModel: void 0,
                    labelData: {
                        anyWordBreaks: !1,
                        labelInfo: []
                    }
                };
                return defaultData;
            }
            function getMinMaxForAllFrames(playData, getExtents) {
                var extents = {
                    minY: null,
                    maxY: null,
                    minX: null,
                    maxX: null
                }, hasData = !1;
                if (playData.allViewModels && playData.allViewModels.length > 0) for (var i = 0, len = playData.allViewModels.length; i < len; i++) {
                    var data_3 = playData.allViewModels[i];
                    if (!_.isEmpty(data_3.dataPoints)) {
                        hasData = !0;
                        var e = getExtents(data_3);
                        extents = {
                            minY: d3.min([ e.minY, extents.minY ]),
                            maxY: d3.max([ e.maxY, extents.maxY ]),
                            minX: d3.min([ e.minX, extents.minX ]),
                            maxX: d3.max([ e.maxX, extents.maxX ])
                        };
                    }
                }
                return hasData ? extents : null;
            }
            function getLabelData(keys, keyColumn) {
                for (var textProperties = {
                    fontFamily: visuals.Font.Family.regular.css,
                    fontSize: jsCommon.PixelConverter.toString(14)
                }, labelInfo = [], anyWordBreaks = !1, _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
                    var key = keys_1[_i], labelWidth = jsCommon.WordBreaker.getMaxWordWidth(key.escapedText, powerbi.TextMeasurementService.measureSvgTextWidth, textProperties);
                    anyWordBreaks = anyWordBreaks || jsCommon.WordBreaker.hasBreakers(key.escapedText) || key.escapedText.indexOf("-") > -1, 
                    labelInfo.push({
                        label: key.escapedText,
                        labelWidth: labelWidth
                    });
                }
                return {
                    labelInfo: labelInfo,
                    anyWordBreaks: anyWordBreaks,
                    labelFieldName: keyColumn && keyColumn.displayName
                };
            }
            function isDataViewPlayable(dataView, playRole) {
                void 0 === playRole && (playRole = "Play");
                var firstRowSourceRoles = dataView.matrix && dataView.matrix.rows && dataView.matrix.rows.levels && dataView.matrix.rows.levels[0] && dataView.matrix.rows.levels[0].sources && dataView.matrix.rows.levels[0].sources[0] && dataView.matrix.rows.levels[0].sources[0].roles;
                return firstRowSourceRoles && firstRowSourceRoles[playRole];
            }
            function renderTraceLines(allDataPoints, traceLineRenderer, shouldAnimate) {
                var selectedDataPoints = _.filter(allDataPoints, function(d) {
                    return d.selected;
                });
                selectedDataPoints = _.uniq(selectedDataPoints, function(d) {
                    return d.identity.getKey();
                }), traceLineRenderer.render(selectedDataPoints, shouldAnimate);
            }
            function getSubtotals(dataView) {
                if (dataView && dataView.matrix) {
                    var subtotalChild = _.find(dataView.matrix.rows.root.children, function(row) {
                        return row.isSubtotal;
                    });
                    if (subtotalChild) {
                        for (var totalValuesLength = _.size(subtotalChild.values), valueSourcesLength = _.size(dataView.matrix.valueSources), totals = {}, i = 0; i < valueSourcesLength; i++) {
                            var roles = dataView.matrix.valueSources[i].roles, total = visuals.AxisHelper.normalizeNonFiniteNumber(subtotalChild.values[totalValuesLength - valueSourcesLength + i].value);
                            for (var role in roles) totals[role] = total;
                        }
                        return totals;
                    }
                }
            }
            PlayChart.FrameStepDuration = 800, PlayChart.FrameAnimationDuration = 750, PlayChart.ClassName = "playChart", 
            PlayChart.convertMatrixToCategorical = convertMatrixToCategorical, PlayChart.converter = converter, 
            PlayChart.getDefaultPlayData = getDefaultPlayData, PlayChart.getMinMaxForAllFrames = getMinMaxForAllFrames, 
            PlayChart.isDataViewPlayable = isDataViewPlayable, PlayChart.renderTraceLines = renderTraceLines, 
            PlayChart.getSubtotals = getSubtotals;
        }(PlayChart = visuals.PlayChart || (visuals.PlayChart = {}));
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var ChartClassName = "realTimeLineChart", ToleranceMultiplier = 1.5, DefaultDuration = 3e5, RealTimeLineChart = function() {
            function RealTimeLineChart(options) {
                this.animator = options.animator, this.maxDataValue = Number.MIN_VALUE, this.newDataInterval = 0, 
                this.duration = DefaultDuration;
            }
            return RealTimeLineChart.prototype.init = function(options) {
                this.options = options;
                var cartesianSVG = this.cartesianSVG = options.svg;
                this.host = options.host, this.currentViewport = options.viewport, this.cartesianVisualHost = options.cartesianHost, 
                this.style = options.style, cartesianSVG.classed(ChartClassName, !0).classed("cartesianChart", !0);
                var mainGraphicsSVG = this.mainGraphicsSVG = cartesianSVG.append("svg");
                mainGraphicsSVG.classed("mainGraphicsSVG", !0), this.mainGraphicsContext = mainGraphicsSVG.append("g").classed("mainGraphicsContext", !0), 
                this.data = {
                    series: [],
                    dataLabelsSettings: visuals.LineChart.getDefaultLineChartLabelSettings(),
                    hasDynamicSeries: !1,
                    categories: [],
                    categoryMetadata: void 0,
                    valuesMetadata: [],
                    categoryData: [],
                    lineStyle: visuals.LineStyle.getDefault()
                };
            }, RealTimeLineChart.prototype.setData = function(dataViews) {
                if (this.data || (this.data = {
                    series: [],
                    dataLabelsSettings: visuals.LineChart.getDefaultLineChartLabelSettings(),
                    hasDynamicSeries: !1,
                    categories: [],
                    categoryMetadata: void 0,
                    valuesMetadata: [],
                    categoryData: [],
                    lineStyle: visuals.LineStyle.getDefault()
                }), !_.isEmpty(dataViews)) {
                    var dataView = _.first(dataViews);
                    if (dataView.categorical) {
                        var categoryAxisProperties = visuals.CartesianHelper.getCategoryAxisProperties(dataView.metadata), durationValue = categoryAxisProperties.duration;
                        durationValue && (this.duration = durationValue);
                        var dataViewCat = this.dataViewCat = dataView.categorical;
                        this.removeOldData();
                        var dvCategories = dataViewCat.categories, categoryType = powerbi.ValueType.fromDescriptor({
                            text: !0
                        });
                        dvCategories && dvCategories.length > 0 && dvCategories[0].source && dvCategories[0].source.type && (categoryType = dvCategories[0].source.type);
                        var isScalar = visuals.ScalarUtils.canHaveScalarAxis(dataView.metadata ? dataView.metadata.objects : null, visuals.lineChartProps.categoryAxis.axisType, categoryType), convertedData = visuals.LineChart.converter({
                            dataView: dataView,
                            style: this.style,
                            isScalar: isScalar
                        });
                        this.mergeNewData(convertedData), this.removeOldData(this.newDataInterval);
                    }
                }
            }, RealTimeLineChart.prototype.hasLegend = function() {
                return this.data && (this.data.hasDynamicSeries || !_.isEmpty(this.data.series));
            }, RealTimeLineChart.prototype.calculateAxesProperties = function(options) {
                return this.currentViewport = options.viewport, this.margin = options.margin, this.newAxisData && (this.axisData = this.newAxisData), 
                this.newAxisData = this.createAxisData(options), this.axisData || (this.axisData = this.newAxisData), 
                [ this.xAxisProperties, this.yAxisProperties ];
            }, RealTimeLineChart.prototype.overrideXScale = function(xProperties) {
                this.xAxisProperties = xProperties;
            }, RealTimeLineChart.prototype.render = function(suppressAnimations, resizeMode) {
                if (!this.containsEmptySeries()) return this.renderLines(), this.animator && this.animator.refreshLastUpdate(), 
                {
                    dataPoints: [],
                    behaviorOptions: [],
                    labelDataPoints: [],
                    labelsAreNumeric: !0,
                    labelDataPointGroups: [],
                    animateLabels: !1
                };
            }, RealTimeLineChart.prototype.calculateLegend = function() {
                var legendData = visuals.Legend.getDefaultLegendData();
                if (this.containsEmptySeries()) return legendData;
                var data = this.data, dataViewCat = this.dataViewCat, legendDataPoints = [], formatStringProp = visuals.lineChartProps.general.formatString, seriesYCol = null;
                if (dataViewCat.values) for (var _i = 0, _a = data.series; _i < _a.length; _i++) {
                    var series = _a[_i], label = visuals.converterHelper.getFormattedLegendLabel(series.yCol, dataViewCat.values, formatStringProp);
                    seriesYCol = series.yCol, legendDataPoints.push({
                        color: series.color,
                        icon: visuals.LegendIcon.Line,
                        label: label,
                        identity: series.identity,
                        selected: series.selected
                    });
                }
                var dvValues = dataViewCat ? dataViewCat.values : null, title = dvValues && dvValues.source ? dvValues.source.displayName : "";
                return legendData.title = title, legendData.dataPoints = legendDataPoints, legendData;
            }, RealTimeLineChart.prototype.onClearSelection = function() {}, RealTimeLineChart.prototype.createAxisData = function(options) {
                var data = this.data;
                if (data) {
                    var yMetaDataColumn;
                    this.containsEmptySeries() || (yMetaDataColumn = data.series[0].yCol);
                    var xSeries = this.truncateSeries(), xDomain = visuals.AxisHelper.createDomain(xSeries, data.categoryMetadata ? data.categoryMetadata.type : powerbi.ValueType.fromDescriptor({
                        text: !0
                    }), !0, [ this.getMinData() + this.newDataInterval, null ]), viewPort = options.viewport, xSpan = viewPort.width, xAxisProperties = this.xAxisProperties = visuals.AxisHelper.createAxis({
                        pixelSpan: xSpan,
                        dataDomain: xDomain,
                        metaDataColumn: data.categoryMetadata,
                        formatString: visuals.valueFormatter.getFormatString(data.categoryMetadata, visuals.columnChartProps.general.formatString),
                        outerPadding: 10,
                        isCategoryAxis: !0,
                        isScalar: !0,
                        isVertical: !1,
                        categoryThickness: null,
                        useTickIntervalForDisplayUnits: !0,
                        getValueFn: function(index, type) {
                            return visuals.CartesianHelper.lookupXValue(data, index, type, !0);
                        },
                        scaleType: visuals.axisScale.linear,
                        margin: options.margin,
                        preventNice: options.preventNiceX
                    }), valueDomain = visuals.AxisHelper.createValueDomain(xSeries, !1), margin = this.margin, yAxisProperties = this.yAxisProperties = visuals.AxisHelper.createAxis({
                        pixelSpan: viewPort.height - margin.top - margin.bottom,
                        dataDomain: valueDomain,
                        metaDataColumn: yMetaDataColumn,
                        formatString: visuals.valueFormatter.getFormatString(yMetaDataColumn, visuals.columnChartProps.general.formatString),
                        outerPadding: 0,
                        isScalar: !0,
                        isVertical: !0,
                        useTickIntervalForDisplayUnits: !0,
                        isCategoryAxis: !1,
                        scaleType: visuals.axisScale.linear,
                        margin: options.margin,
                        preventNice: options.preventNiceY
                    });
                    return yAxisProperties.axis.orient("left").tickSize(-xSpan), {
                        x: xAxisProperties,
                        y1: yAxisProperties
                    };
                }
            }, RealTimeLineChart.prototype.truncateSeries = function() {
                var minData = this.getMinData(), lineChartSeries = this.data.series;
                return lineChartSeries ? _.map(lineChartSeries, function(series, idx) {
                    series = powerbi.Prototype.inherit(series), series.data = powerbi.Prototype.inherit(series.data);
                    var minIndex = _.findIndex(series.data, function(dp) {
                        return dp && dp.categoryValue >= minData;
                    }), start = 0;
                    return minIndex > 0 && start++, series.data = series.data.slice(start), series;
                }) : [];
            }, RealTimeLineChart.prototype.removeOldData = function(realTimeDelta) {
                if (void 0 === realTimeDelta && (realTimeDelta = 0), !this.containsEmptySeries()) {
                    for (var minData = this.getMinData(realTimeDelta), data = this.data, _i = 0, _a = data.series; _i < _a.length; _i++) {
                        var s = _a[_i], index_1 = _.findIndex(s.data, function(dp) {
                            return dp && dp.categoryValue > minData;
                        });
                        index_1 > 0 && (s.data = s.data.slice(index_1));
                    }
                    var index = _.findIndex(data.categoryData, function(c) {
                        return c && c.categoryValue > minData;
                    });
                    index > 0 && (data.categoryData = this.data.categoryData.slice(index), data.categories = this.data.categories.slice(index));
                }
            }, RealTimeLineChart.prototype.mergeNewData = function(newData) {
                if (this.containsEmptySeries()) return this.data = newData, void (this.maxDataValue = this.getMaxData());
                this.data.series = RealTimeLineChart.mergeSeries(this.data.series, newData.series, this.maxDataValue), 
                RealTimeLineChart.mergeCategories(this.data, newData, this.maxDataValue);
                var newMaxData = this.getMaxData();
                this.newDataInterval = this.maxDataValue && newMaxData ? newMaxData - this.maxDataValue : 0, 
                this.maxDataValue = newMaxData;
            }, RealTimeLineChart.prototype.getMaxData = function() {
                for (var maxDataValue = 0, _i = 0, _a = this.data.series; _i < _a.length; _i++) {
                    var s = _a[_i];
                    s.data.length && (maxDataValue = Math.max(_.last(s.data).categoryValue, maxDataValue));
                }
                return maxDataValue;
            }, RealTimeLineChart.prototype.getMinData = function(additionalDelta) {
                return void 0 === additionalDelta && (additionalDelta = 0), this.maxDataValue - this.duration - additionalDelta * ToleranceMultiplier;
            }, RealTimeLineChart.prototype.renderLines = function() {
                var xScale = this.axisData.x.scale, yScale = this.axisData.y1.scale, viewport = this.currentViewport, margin = this.margin, height = viewport.height - margin.top - margin.bottom, width = viewport.width - margin.left - margin.right, xTranslation = xScale(xScale.domain()[0] + this.newDataInterval) - xScale(xScale.domain()[0]), line = d3.svg.line().x(function(d, i) {
                    return xScale(d.categoryValue);
                }).y(function(d, i) {
                    return yScale(d.value);
                });
                this.mainGraphicsSVG.attr({
                    x: 0,
                    height: height,
                    width: width
                }), this.mainGraphicsContext.attr("transform", visuals.SVGUtil.translate(0, 0));
                var lines = this.mainGraphicsContext.selectAll(".line").data(this.data.series, function(s) {
                    return s.identity.getKey();
                });
                lines.enter().append("path").classed("line", !0), lines.style("stroke", function(d) {
                    return d.color;
                }).attr("d", function(d) {
                    return line(d.data);
                }), lines.exit().remove(), this.animator && this.animator.animate({
                    mainGraphicsContext: this.mainGraphicsContext,
                    interactivityService: null,
                    xTranslation: xTranslation
                });
            }, RealTimeLineChart.prototype.containsEmptySeries = function() {
                return !this.data || _.isEmpty(this.data.series);
            }, RealTimeLineChart.mergeCategories = function(existingChartData, newChartData, maxDataValue) {
                var categories = newChartData.categories, overlapPoint = _.findIndex(categories, function(c) {
                    return c && c.categoryValue > maxDataValue;
                });
                overlapPoint > -1 ? (existingChartData.categories = existingChartData.categories.concat(newChartData.categories.slice(overlapPoint)), 
                existingChartData.categoryData = existingChartData.categoryData.concat(newChartData.categoryData.slice(overlapPoint))) : (existingChartData.categories = newChartData.categories, 
                existingChartData.categoryData = newChartData.categoryData);
            }, RealTimeLineChart.mergeSeries = function(existingSeries, newSeries, maxDataValue) {
                for (var result = [], _i = 0, newSeries_1 = newSeries; _i < newSeries_1.length; _i++) {
                    var newSerie = newSeries_1[_i], matchingSeries = _.find(existingSeries, function(s) {
                        return s.identity.equals(newSerie.identity);
                    });
                    if (matchingSeries) {
                        result.push(matchingSeries);
                        for (var _a = 0, _b = newSerie.data; _a < _b.length; _a++) {
                            var dp = _b[_a];
                            dp.categoryValue > maxDataValue && matchingSeries.data.push(dp);
                        }
                    } else result.push(newSerie);
                }
                return result;
            }, RealTimeLineChart.prototype.getCartesianVisualCapabilities = function() {
                return {
                    supportsHierarchicalCategoryAxis: !1
                };
            }, RealTimeLineChart.prototype.getStaticSeriesRole = function() {
                return "Y";
            }, RealTimeLineChart;
        }();
        visuals.RealTimeLineChart = RealTimeLineChart;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var MaxAnimationDurationInMs = 1500, EasingFunction = "linear", RealTimeLineChartAnimator = function(_super) {
            function RealTimeLineChartAnimator(options) {
                var _this = _super.call(this, options) || this;
                return _this.lastUpdateTime = null, _this;
            }
            return __extends(RealTimeLineChartAnimator, _super), RealTimeLineChartAnimator.prototype.refreshLastUpdate = function() {
                this.lastUpdateTime = Date.now();
            }, RealTimeLineChartAnimator.prototype.getDuration = function() {
                if (this.lastUpdateTime) {
                    var duration = Math.min(Date.now() - this.lastUpdateTime, MaxAnimationDurationInMs);
                    return Math.max(this.animationDuration, duration);
                }
                return this.animationDuration;
            }, RealTimeLineChartAnimator.prototype.getEasing = function() {
                return EasingFunction;
            }, RealTimeLineChartAnimator.prototype.animate = function(options) {
                var mainGraphicsContext = options.mainGraphicsContext, duration = this.getDuration();
                return mainGraphicsContext.transition().duration(duration).ease(this.getEasing()).attrTween("transform", function(datum, idx, attr) {
                    return function(t) {
                        return visuals.SVGUtil.translate(-(options.xTranslation * t), 0);
                    };
                }), {
                    failed: !1
                };
            }, RealTimeLineChartAnimator;
        }(visuals.BaseAnimator);
        visuals.RealTimeLineChartAnimator = RealTimeLineChartAnimator;
        var DashboardColumnChartAnimator = function(_super) {
            function DashboardColumnChartAnimator(options) {
                return _super.call(this, options) || this;
            }
            return __extends(DashboardColumnChartAnimator, _super), DashboardColumnChartAnimator.prototype.animate = function(options) {
                var result = {
                    failed: !0,
                    shapes: null
                }, viewModel = options.viewModel, previousViewModel = this.previousViewModel, dataPointCount = viewModel.categories.length * viewModel.series.length;
                return dataPointCount > visuals.AnimatorCommon.MaxDataPointsToAnimate ? result : (previousViewModel && (result = this.animateDefaultShapes(options.viewModel, options.series, options.layout, options.itemCS)), 
                this.previousViewModel = viewModel, result);
            }, DashboardColumnChartAnimator.prototype.getEasing = function() {
                return EasingFunction;
            }, DashboardColumnChartAnimator.prototype.animateDefaultShapes = function(data, series, layout, itemCS) {
                var shapeSelection = series.selectAll(itemCS.selector), shapes = shapeSelection.data(function(d) {
                    return d.data;
                }, function(d) {
                    return d.key;
                });
                return shapes.enter().append("rect").attr("class", function(d) {
                    return itemCS.class.concat(d.highlight ? " highlight" : "");
                }), shapes.style("fill", function(d) {
                    return d.color;
                }).style("fill-opacity", function(d) {
                    return visuals.ColumnUtil.getFillOpacity(d.selected, d.highlight, !1, data.hasHighlights);
                }).transition().ease(this.getEasing()).duration(this.animationDuration).attr(layout.shapeLayout), 
                shapes.exit().remove(), {
                    failed: !1,
                    shapes: shapes
                };
            }, DashboardColumnChartAnimator;
        }(visuals.BaseAnimator);
        visuals.DashboardColumnChartAnimator = DashboardColumnChartAnimator;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {})), powerbi.define("PowerBIVisuals/visuals/scatter/scatterChart.converter", function(imports) {
    function converter(dataView, options, playFrameInfo, subtotals) {
        return options.useMatrixDV ? converterForMatrix(dataView, options, playFrameInfo) : dataView.categorical && dataView.categorical.values ? converterForCategorical(dataView, options, playFrameInfo, subtotals) : void 0;
    }
    function converterForCategorical(dataView, options, playFrameInfo, subtotals) {
        var categoryValues, categoryFormatter, categoryObjects, categoryIdentities, reader = powerbi.data.createDataViewCategoricalReaderAdvanced(dataView, {
            colorOptions: {
                valueRole: "Size",
                visualStyle: options.style
            }
        }), currentViewport = options.viewport, colorPalette = options.colors, interactivityService = options.interactivityService, categoryAxisProperties = options.categoryAxisProperties, valueAxisProperties = options.valueAxisProperties, dataViewCategorical = dataView.categorical, gradientValueColumn = GradientUtils.getGradientValueColumn(dataViewCategorical);
        dataViewCategorical.categories && dataViewCategorical.categories.length > 0 ? (categoryValues = dataViewCategorical.categories[0].values, 
        categoryFormatter = valueFormatter.create({
            format: valueFormatter.getFormatString(dataViewCategorical.categories[0].source, scatterChartProps.general.formatString),
            value: categoryValues[0],
            value2: categoryValues[categoryValues.length - 1],
            columnType: reader.data.getCategoryType("Category")
        }), categoryIdentities = dataViewCategorical.categories[0].identity, categoryObjects = dataViewCategorical.categories[0].objects) : (categoryValues = [ null ], 
        categoryFormatter = valueFormatter.createDefaultFormatter(null));
        var legendData, categories = dataViewCategorical.categories, dataValues = dataViewCategorical.values, hasDynamicSeries = !!dataValues.source, grouped = dataValues.grouped(), dvSource = dataValues.source, scatterMetadata = getMetadata(grouped, dvSource), dataLabelsSettings = LabelUtils.getDefaultPointLabelSettings(), sizeRange = getSizeRangeForGroups(grouped, scatterMetadata.idx.size), objProps = getObjectProperties(dataView, dataLabelsSettings, !1), colorHelper = new visuals.ColorHelper(colorPalette, scatterChartProps.dataPoint.fill, objProps.defaultDataPointColor, objProps.defaultCategoryColor), dataPointSeries = createDataPointSeries(reader, dataValues, scatterMetadata, categories, categoryValues, categoryFormatter, categoryIdentities, categoryObjects, colorHelper, currentViewport, hasDynamicSeries, dataLabelsSettings, gradientValueColumn, objProps.colorByCategory, playFrameInfo, options.tooltipsEnabled), dataPoints = _.reduce(dataPointSeries, function(a, s) {
            return a.concat(s.dataPoints);
        }, []);
        return legendData = hasDynamicSeries ? Legend.buildSeriesLegendData({
            dataView: dataView,
            style: options.style,
            showByDefault: !0,
            simpleMarkerProp: scatterChartProps.bubbles.markerShape
        }) : {
            dataPoints: []
        }, categoryAxisProperties && null !== categoryAxisProperties.showAxisTitle && categoryAxisProperties.showAxisTitle === !1 && (scatterMetadata.axesLabels.x = null), 
        valueAxisProperties && null !== valueAxisProperties.showAxisTitle && valueAxisProperties.showAxisTitle === !1 && (scatterMetadata.axesLabels.y = null), 
        interactivityService && (interactivityService.applySelectionStateToData(dataPoints), 
        interactivityService.applySelectionStateToData(legendData.dataPoints)), {
            xCol: scatterMetadata.cols.x,
            yCol: scatterMetadata.cols.y,
            hasSize: !!scatterMetadata.cols.size,
            dataPoints: dataPoints,
            dataPointSeries: dataPointSeries,
            legendData: legendData,
            axesLabels: scatterMetadata.axesLabels,
            size: scatterMetadata.cols.size,
            sizeRange: sizeRange,
            dataLabelsSettings: dataLabelsSettings,
            hasDynamicSeries: hasDynamicSeries,
            fillPoint: objProps.fillPoint,
            colorBorder: objProps.colorBorder,
            colorByCategory: objProps.colorByCategory,
            multiplier: objProps.bubbleSizeMultiplier,
            xSubtotal: subtotals && subtotals[scatterRoleNames.x],
            ySubtotal: subtotals && subtotals[scatterRoleNames.y],
            plotAreaShadingSettings: objProps.plotAreaShadingSettings,
            ratioLineSettings: objProps.ratioLineSettings,
            markerShape: objProps.markerShape,
            dataVolume: objProps.dataVolume
        };
    }
    function converterForMatrix(dataView, options, playFrameInfo) {
        if (dataView && dataView.matrix && 0 !== _.size(dataView.matrix.valueSources)) {
            var interactivityService = options.interactivityService, dataLabelsSettings = LabelUtils.getDefaultPointLabelSettings(), objProps = getObjectProperties(dataView, dataLabelsSettings, !0), scatterMetadata = getMetadataFromMatrixDataView(dataView), sizeRange = {
                min: Number.MAX_VALUE,
                max: Number.MIN_VALUE
            }, sizeMetadata = scatterMetadata.cols.size;
            sizeMetadata && sizeMetadata.aggregates && (sizeRange = {
                min: sizeMetadata.aggregates.minLocal || sizeMetadata.aggregates.min,
                max: sizeMetadata.aggregates.maxLocal || sizeMetadata.aggregates.max
            });
            for (var valueSources = dataView.matrix.valueSources, tooltipValuesIndices = [], index = 0; index < valueSources.length; index++) DataRoleHelper.hasRole(valueSources[index], "Tooltips") && tooltipValuesIndices.push(index);
            var legendData, converterContext = {
                colorHelper: new visuals.ColorHelper(options.colors, scatterChartProps.dataPoint.fill, objProps.defaultDataPointColor, objProps.defaultCategoryColor),
                metadata: scatterMetadata,
                hasDynamicSeries: DataRoleHelper.hasRoleInDataView(dataView, "Series"),
                tooltipsEnabled: options.tooltipsEnabled,
                sizeRange: sizeRange,
                dataLabelSettings: dataLabelsSettings,
                playFrameInfo: playFrameInfo,
                tooltipValuesIndices: tooltipValuesIndices,
                gradientIndex: _.findIndex(valueSources, function(valueSource) {
                    return DataRoleHelper.hasRole(valueSource, "Gradient");
                }),
                objProps: objProps
            }, dataPointSeries = createDataPointSeriesFromMatrix(dataView, converterContext), dataPoints = _.reduce(dataPointSeries.series, function(a, s) {
                return a.concat(s.dataPoints);
            }, []);
            return legendData = converterContext.hasDynamicSeries ? Legend.buildFromFirstMatrixRowLevel({
                dataView: dataView,
                colorHelper: converterContext.colorHelper,
                formatStringProp: null,
                showByDefault: !0,
                markerShapePropIdentifier: scatterChartProps.bubbles.markerShape
            }) : Legend.getDefaultLegendData(), interactivityService && (interactivityService.applySelectionStateToData(dataPoints), 
            interactivityService.applySelectionStateToData(legendData.dataPoints)), {
                xCol: scatterMetadata.cols.x,
                yCol: scatterMetadata.cols.y,
                hasSize: !!scatterMetadata.cols.size,
                dataPoints: dataPoints,
                dataPointSeries: dataPointSeries.series,
                legendData: legendData,
                axesLabels: scatterMetadata.axesLabels,
                size: scatterMetadata.cols.size,
                sizeRange: sizeRange,
                dataLabelsSettings: dataLabelsSettings,
                hasDynamicSeries: converterContext.hasDynamicSeries,
                fillPoint: objProps.fillPoint,
                colorBorder: objProps.colorBorder,
                colorByCategory: objProps.colorByCategory,
                multiplier: objProps.bubbleSizeMultiplier,
                xSubtotal: dataPointSeries.xSubtotal,
                ySubtotal: dataPointSeries.ySubtotal,
                plotAreaShadingSettings: objProps.plotAreaShadingSettings,
                ratioLineSettings: objProps.ratioLineSettings,
                markerShape: objProps.markerShape,
                dataVolume: objProps.dataVolume
            };
        }
    }
    function getSizeRangeForGroups(dataViewValueGroups, sizeColumnIndex) {
        var result = {};
        return dataViewValueGroups && dataViewValueGroups.forEach(function(group) {
            var sizeColumn = ScatterChart.getMeasureValue(sizeColumnIndex, group.values), currentRange = AxisHelper.getRangeForColumn(sizeColumn);
            (null == result.min || result.min > currentRange.min) && (result.min = currentRange.min), 
            (null == result.max || result.max < currentRange.max) && (result.max = currentRange.max);
        }), result;
    }
    function createDataPointSeries(reader, dataValues, metadata, categories, categoryValues, categoryFormatter, categoryIdentities, categoryObjects, colorHelper, viewport, hasDynamicSeries, labelSettings, gradientValueColumn, colorByCategory, playFrameInfo, tooltipsEnabled) {
        var hasX = reader.data.hasValues("X"), hasY = reader.data.hasValues("Y");
        if (!hasX && !hasY) return [];
        for (var dataPointSeries = [], indicies = metadata.idx, formatStringProp = scatterChartProps.general.formatString, dataValueSource = dataValues.source, grouped = dataValues.grouped(), categoryColumn = _.isEmpty(categories) ? null : categories[0], staticObjects = reader.objects.getStaticObjects(), staticShape = DataViewObjects.getValue(staticObjects, scatterChartProps.bubbles.markerShape, visuals.markerShape.circle), seriesIndex = 0, len = grouped.length; seriesIndex < len; seriesIndex++) {
            var grouping = grouped[seriesIndex], seriesValues = grouping.values, measureX = ScatterChart.getMeasureValue(indicies.x, seriesValues), measureY = ScatterChart.getMeasureValue(indicies.y, seriesValues), measureSize = ScatterChart.getMeasureValue(indicies.size, seriesValues), seriesColor = void 0;
            hasDynamicSeries && (seriesColor = reader.colors.createBySeries(seriesIndex));
            var seriesShape = void 0;
            seriesShape = reader.data.hasSeries() && DataViewObjects.getValue(staticObjects, scatterChartProps.bubbles.showSeries) ? DataViewObjects.getValue(reader.objects.getSeriesDataObjects(seriesIndex), scatterChartProps.bubbles.markerShape, staticShape) : staticShape;
            var seriesId = reader.identities.createForSeries(seriesIndex, [ scatterRoleNames.size ]), series = {
                identityKey: grouping && grouping.identity && grouping.identity.key || "",
                dataPoints: [],
                hasSize: !(!measureSize || !measureSize.values),
                fill: seriesColor,
                identity: seriesId,
                markerShape: seriesShape,
                name: hasDynamicSeries ? valueFormatter.format(reader.data.getSeriesName(seriesIndex), reader.objects.getSeriesFormatString()) : void 0
            };
            dataPointSeries.push(series);
            for (var _loop_3 = function(categoryIndex, ilen) {
                var categoryValue = categoryValues[categoryIndex], xVal = hasX ? AxisHelper.normalizeNonFiniteNumber(reader.data.getValue("X", categoryIndex, seriesIndex)) : 0, yVal = hasY ? AxisHelper.normalizeNonFiniteNumber(reader.data.getValue("Y", categoryIndex, seriesIndex)) : 0, size = AxisHelper.normalizeNonFiniteNumber(reader.data.getValue("Size", categoryIndex, seriesIndex));
                if (null == xVal || null == yVal) return "continue";
                var color = void 0;
                color = colorByCategory ? reader.colors.createByCategory(categoryIndex) : reader.colors.createBySeries(seriesIndex, categoryIndex);
                var identity = SelectionIdBuilder.builder().withCategory(categoryColumn, categoryIndex).withSeries(dataValues, grouping).createSelectionId(), tooltipBuilder = new CategoricalLazyTooltipBuilder(reader.columns);
                if (tooltipsEnabled) {
                    var defaultFormatter = FormattingStrategies.defaultFormatter(formatStringProp), fallbackFormatter = FormattingStrategies.fallbackBasedOnType(formatStringProp);
                    tooltipBuilder.withColumnValueByIndex(categoryColumn, categoryIndex, !0, defaultFormatter), 
                    hasDynamicSeries && tooltipBuilder.withColumnValue(dataValueSource, grouping.name, !0, defaultFormatter), 
                    tooltipBuilder.withColumnValueByIndex(measureX, categoryIndex, !1, fallbackFormatter).withColumnValueByIndex(measureY, categoryIndex, !1, fallbackFormatter).withColumnValueByIndex(measureSize, categoryIndex, !1, fallbackFormatter).withColumnValueByIndex(gradientValueColumn, categoryIndex, !1, fallbackFormatter), 
                    playFrameInfo && tooltipBuilder.withValue(playFrameInfo.column.displayName, playFrameInfo.label), 
                    tooltipBuilder.withAllValuesForRole("Tooltips", categoryIndex, seriesIndex, !1, fallbackFormatter);
                }
                var dataPoint = {
                    x: xVal,
                    y: yVal,
                    size: size,
                    radius: {
                        sizeMeasure: measureSize,
                        index: categoryIndex
                    },
                    fill: color,
                    formattedCategory: ScatterChart.createLazyFormattedCategory(categoryFormatter, null != categories ? categoryValue : grouping.name),
                    selected: !1,
                    identity: identity,
                    tooltipInfo: function() {
                        return tooltipBuilder.getTooltipItems();
                    },
                    labelFill: labelSettings.fontProperties.color,
                    markerShape: seriesShape
                };
                series.dataPoints.push(dataPoint);
            }, categoryIndex = 0, ilen = categoryValues.length; categoryIndex < ilen; categoryIndex++) _loop_3(categoryIndex, ilen);
        }
        return dataPointSeries;
    }
    function createDataPointSeriesFromMatrix(dataView, converterContext) {
        var dataPointSeries = [], matrix = dataView.matrix;
        if (!matrix.rows.root || 0 === _.size(matrix.rows.root.children)) return {
            series: dataPointSeries
        };
        var subtotals, seriesColumn = _.find(matrix.rows.levels, function(level) {
            return DataRoleHelper.hasRole(level.sources[0], "Series");
        }), categoryColumn = _.find(matrix.rows.levels, function(level) {
            return DataRoleHelper.hasRole(level.sources[0], "Category");
        }), seriesHierarchyLevel = seriesColumn ? matrix.rows.root : void 0, metadata = converterContext.metadata, sizeValues = metadata.idx.size !== -1 ? matrix.valueSources[metadata.idx.size] : void 0, xIndex = metadata.idx.x, yIndex = metadata.idx.y;
        if (seriesHierarchyLevel) {
            for (var _i = 0, _a = seriesHierarchyLevel.children; _i < _a.length; _i++) {
                var seriesNode = _a[_i], seriesColor = converterContext.colorHelper.getColorForSeriesValue(seriesNode.objects, seriesHierarchyLevel.childIdentityFields, seriesNode.value), seriesIdentity = new SelectionIdBuilder().withColumnIdentity(seriesNode.identity, seriesColumn.sources[0].queryName).createSelectionId(), seriesShape = void 0;
                seriesShape = powerbi.DataViewObjects.getValue(dataView.metadata.objects, scatterChartProps.bubbles.showSeries) ? powerbi.DataViewObjects.getValue(seriesNode.objects, scatterChartProps.bubbles.markerShape, converterContext.objProps.markerShape) : converterContext.objProps.markerShape;
                var seriesName = valueFormatter.format(seriesNode.value, powerbi.DataViewObjects.getValue(seriesColumn.sources[0].objects, scatterChartProps.general.formatString)), seriesDataPoint = {
                    identityKey: seriesNode.identity && seriesNode.identity.key || "",
                    dataPoints: [],
                    hasSize: !!sizeValues,
                    fill: seriesColor,
                    identity: seriesIdentity,
                    markerShape: seriesShape,
                    name: seriesName
                };
                dataPointSeries.push(seriesDataPoint);
                var seriesCreationParams = {
                    currentSeries: seriesNode,
                    currentSeriesColor: seriesColor,
                    seriesShape: seriesShape
                };
                if (seriesDataPoint.dataPoints = createDataPointsForSeries(dataView, seriesCreationParams, converterContext), 
                !categoryColumn && 0 === _.size(seriesDataPoint.dataPoints)) {
                    var seriesColumn_1 = matrix.rows.levels[seriesNode.level].sources[0], categoryFormatter = getCategoryFormatter(void 0, seriesColumn_1), creationOptions = {
                        category: seriesNode,
                        categoryMetadata: seriesColumn_1,
                        categoryIdentityFields: seriesNode.childIdentityFields,
                        currentSeries: seriesNode,
                        currentSeriesMetadata: seriesColumn_1,
                        currentSeriesColor: seriesColor,
                        categoryFormatter: categoryFormatter,
                        seriesShape: seriesShape
                    }, dataPoint = createDataPoint(dataView, creationOptions, converterContext);
                    dataPoint && seriesDataPoint.dataPoints.push(dataPoint);
                }
            }
            var children = dataView.matrix.rows.root.children, subtotalChild = _.find(children, function(child) {
                return child.isSubtotal;
            });
            subtotalChild && (subtotals = getAxisSubtotals(xIndex, yIndex, subtotalChild));
        } else if (categoryColumn) {
            var measureSource = null != sizeValues ? sizeValues.queryName : "", seriesColor = converterContext.colorHelper.getColorForMeasure(null, measureSource), seriesDataPoint = {
                identityKey: "",
                dataPoints: [],
                hasSize: !!sizeValues,
                fill: seriesColor,
                markerShape: converterContext.objProps.markerShape
            };
            dataPointSeries.push(seriesDataPoint);
            var seriesCreationParams = {
                currentSeries: matrix.rows.root,
                currentSeriesColor: seriesColor,
                seriesShape: converterContext.objProps.markerShape
            };
            seriesDataPoint.dataPoints = createDataPointsForSeries(dataView, seriesCreationParams, converterContext);
            var children = dataView.matrix.rows.root.children, subtotalChild = _.find(children, function(child) {
                return child.isSubtotal;
            });
            subtotalChild && (subtotals = getAxisSubtotals(xIndex, yIndex, subtotalChild));
        } else {
            var measureSource = null != sizeValues ? sizeValues.queryName : "", seriesColor = converterContext.colorHelper.getColorForMeasure(null, measureSource), series = {
                identityKey: "",
                dataPoints: [],
                hasSize: !!sizeValues,
                fill: seriesColor
            };
            dataPointSeries.push(series);
            var seriesCreationParams = {
                currentSeries: matrix.rows.root,
                currentSeriesColor: seriesColor,
                seriesShape: converterContext.objProps.markerShape
            };
            series.dataPoints = createDataPointsForSeries(dataView, seriesCreationParams, converterContext), 
            subtotals = getAxisSubtotals(xIndex, yIndex, dataView.matrix.rows.root.children[0]);
        }
        return {
            series: dataPointSeries,
            xSubtotal: subtotals && subtotals.xSubtotal,
            ySubtotal: subtotals && subtotals.ySubtotal
        };
    }
    function getAxisSubtotals(xIndex, yIndex, subtotalChild) {
        var xSubtotal, ySubtotal;
        return xIndex !== -1 && (xSubtotal = AxisHelper.normalizeNonFiniteNumber(subtotalChild.values[xIndex].value)), 
        yIndex !== -1 && (ySubtotal = AxisHelper.normalizeNonFiniteNumber(subtotalChild.values[yIndex].value)), 
        {
            xSubtotal: xSubtotal,
            ySubtotal: ySubtotal
        };
    }
    function createDataPointsForSeries(dataview, seriesCreationParams, converterContext) {
        var matrix = dataview.matrix, dataPoints = [], currentSeries = seriesCreationParams.currentSeries, currentSeriesMetadata = currentSeries && null != currentSeries.level ? matrix.rows.levels[currentSeries.level].sources[0] : void 0;
        if (currentSeries.children) {
            var categoryFormatter = void 0;
            categoryFormatter = currentSeriesMetadata ? getCategoryFormatter(currentSeries.children[0], matrix.rows.levels[currentSeries.children[0].level].sources[0]) : valueFormatter.createDefaultFormatter(null);
            for (var index in currentSeries.children) {
                var category = currentSeries.children[index], categoryMetadata = void 0;
                matrix.rows.levels.length > 0 && (categoryMetadata = matrix.rows.levels[category.level].sources[0]);
                var creationParams = {
                    category: category,
                    categoryMetadata: categoryMetadata,
                    categoryIdentityFields: currentSeries.childIdentityFields,
                    currentSeries: currentSeries,
                    currentSeriesMetadata: currentSeriesMetadata,
                    currentSeriesColor: seriesCreationParams.currentSeriesColor,
                    categoryFormatter: categoryFormatter,
                    seriesShape: seriesCreationParams.seriesShape
                };
                concatenateIfNecessary(dataview, creationParams);
                var dataPoint = createDataPoint(dataview, creationParams, converterContext);
                dataPoint && dataPoints.push(dataPoint);
            }
        } else if (currentSeriesMetadata && DataRoleHelper.hasRole(currentSeriesMetadata, "Category") && !currentSeries.children) {
            var categoryFormatter = getCategoryFormatter(currentSeries, currentSeriesMetadata), creationParams = {
                category: currentSeries,
                categoryMetadata: currentSeriesMetadata,
                categoryIdentityFields: currentSeries.childIdentityFields,
                currentSeries: currentSeries,
                currentSeriesMetadata: currentSeriesMetadata,
                currentSeriesColor: seriesCreationParams.currentSeriesColor,
                categoryFormatter: categoryFormatter,
                seriesShape: seriesCreationParams.seriesShape
            };
            concatenateIfNecessary(dataview, creationParams);
            var dataPoint = createDataPoint(dataview, creationParams, converterContext);
            dataPoint && dataPoints.push(dataPoint);
        }
        return dataPoints;
    }
    function concatenateIfNecessary(dataview, creationParams) {
        var matrix = dataview.matrix, categoryLevelValues = creationParams.category.levelValues, needsConcatenation = _.size(categoryLevelValues) > 1;
        if (needsConcatenation) {
            for (var valueType = ValueType.fromDescriptor({
                text: !0
            }), hierarchyVariationProperty = DataViewMetadataColumnUtils.getHierarchyVariationProperty(dataview.metadata.columns), categoryLevel = creationParams.category.level, roles = matrix.rows.levels[categoryLevel].sources[categoryLevelValues[0].levelSourceIndex].roles, columnsToConcatenate = [], _i = 0, _a = matrix.rows.levels[categoryLevel].sources; _i < _a.length; _i++) {
                var levelSource = _a[_i];
                columnsToConcatenate.push(levelSource);
            }
            creationParams.columnsToConcatenate = columnsToConcatenate, creationParams.concatenatedCategoryMetadata = data.DataViewConcatenateCategoricalColumns.createConcatenatedColumnMetadata(Object.keys(roles)[0], columnsToConcatenate, valueType, hierarchyVariationProperty);
        }
    }
    function getCategoryFormatter(category, categoryMetadata) {
        var categoryFormatter;
        if (category) {
            var categoryValues = category.values;
            categoryFormatter = valueFormatter.create({
                format: valueFormatter.getFormatString(categoryMetadata, scatterChartProps.general.formatString),
                value: categoryValues[0],
                value2: categoryValues[_.size(category.values) - 1],
                columnType: null
            });
        } else categoryFormatter = valueFormatter.createDefaultFormatter(null);
        return categoryFormatter;
    }
    function createDataPoint(dataview, creationParams, converterContext) {
        if (!creationParams.category.isSubtotal) {
            var metadata = converterContext.metadata, matrix = dataview.matrix, xIndex = metadata.idx.x, yIndex = metadata.idx.y, sizeIndex = metadata.idx.size, xVal = xIndex !== -1 ? AxisHelper.normalizeNonFiniteNumber(creationParams.category.values[xIndex].value) : 0, yVal = yIndex !== -1 ? AxisHelper.normalizeNonFiniteNumber(creationParams.category.values[yIndex].value) : 0, valueSources = matrix.valueSources;
            if (null != xVal && null != yVal) {
                var size = sizeIndex !== -1 ? AxisHelper.normalizeNonFiniteNumber(creationParams.category.values[sizeIndex].value) : void 0, idBuilder = new SelectionIdBuilder();
                creationParams.categoryMetadata && idBuilder.withColumnIdentity(creationParams.category.identity, creationParams.categoryMetadata.queryName), 
                creationParams.currentSeriesMetadata && idBuilder.withColumnIdentity(creationParams.currentSeries.identity, creationParams.currentSeriesMetadata.queryName);
                var identity = idBuilder.createSelectionId(), sizeRange = converterContext.sizeRange;
                sizeRange.min > size && (sizeRange.min = size), sizeRange.max < size && (sizeRange.max = size);
                var color;
                if (converterContext.hasDynamicSeries) color = creationParams.currentSeriesColor; else if (converterContext.objProps.colorByCategory) color = converterContext.colorHelper.getColorForSeriesValue(creationParams.category.objects, creationParams.categoryIdentityFields, creationParams.category.value); else {
                    var measureSource = null != converterContext.metadata.cols.size ? converterContext.metadata.cols.size.queryName : "";
                    color = converterContext.colorHelper.getColorForMeasure(creationParams.category.objects, measureSource);
                }
                var formatStringProp = scatterChartProps.general.formatString, defaultFormatter = FormattingStrategies.defaultFormatter(formatStringProp), lazyCategoryValueCalc = function() {
                    var categoryLevelValues = creationParams.category.levelValues, categoryValue = creationParams.currentSeries.value, categoryMetadata = creationParams.categoryMetadata;
                    if (categoryLevelValues) {
                        var needsConcatenation = _.size(categoryLevelValues) > 1;
                        needsConcatenation ? (categoryValue = DataViewConcatenateUtil.concatenateValues(_.map(categoryLevelValues, function(levelValue, index) {
                            return defaultFormatter(levelValue.value, creationParams.columnsToConcatenate[index]);
                        })), categoryMetadata = creationParams.concatenatedCategoryMetadata) : categoryValue = categoryLevelValues[0].value;
                    }
                    return categoryValue;
                }, tooltipBuilder = new CategoricalLazyTooltipBuilder((void 0));
                if (converterContext.tooltipsEnabled) {
                    var fallbackFormatter = FormattingStrategies.fallbackBasedOnType(formatStringProp), categoryLevelValues = creationParams.category.levelValues, needsConcatenation = _.size(categoryLevelValues) > 1;
                    needsConcatenation ? tooltipBuilder.withMultipleColumnAndValues(creationParams.columnsToConcatenate, _.map(categoryLevelValues, function(levelValue) {
                        return levelValue.value;
                    }), !0, defaultFormatter) : categoryLevelValues && tooltipBuilder.withColumnValue(creationParams.categoryMetadata, categoryLevelValues[0].value, !0, defaultFormatter), 
                    converterContext.hasDynamicSeries && tooltipBuilder.withColumnValue(creationParams.currentSeriesMetadata, creationParams.currentSeries.value, !0, defaultFormatter), 
                    tooltipBuilder.withColumnValue(metadata.cols.x, xVal, !1, fallbackFormatter).withColumnValue(metadata.cols.y, yVal, !1, fallbackFormatter).withColumnValue(metadata.cols.size, size, !1, fallbackFormatter);
                    var gradientIndex = converterContext.gradientIndex;
                    gradientIndex >= 0 && tooltipBuilder.withColumnValue(valueSources[gradientIndex], creationParams.category.values[gradientIndex].value, !1, fallbackFormatter);
                    var playFrameInfo = converterContext.playFrameInfo;
                    playFrameInfo && tooltipBuilder.withValue(playFrameInfo.column.displayName, playFrameInfo.label);
                    for (var _i = 0, _a = converterContext.tooltipValuesIndices; _i < _a.length; _i++) {
                        var index = _a[_i];
                        tooltipBuilder.withColumnValue(valueSources[index], creationParams.category.values[index].value, !1, fallbackFormatter);
                    }
                }
                var dataPoint = {
                    x: xVal,
                    y: yVal,
                    size: size,
                    radius: {
                        sizeMeasure: null,
                        index: -1,
                        value: size
                    },
                    fill: color,
                    formattedCategory: ScatterChart.createLazyFormattedLazyValue(creationParams.categoryFormatter, function() {
                        return lazyCategoryValueCalc();
                    }),
                    selected: !1,
                    identity: identity,
                    tooltipInfo: function() {
                        return tooltipBuilder.getTooltipItems();
                    },
                    labelFill: converterContext.dataLabelSettings.fontProperties.color,
                    markerShape: creationParams.seriesShape
                };
                return dataPoint;
            }
        }
    }
    function getObjectProperties(dataView, dataLabelsSettings, readMatrix) {
        var objects;
        objects = dataView && dataView.metadata && dataView.metadata.objects ? dataView.metadata.objects : {};
        var objectProperties = {};
        objectProperties.defaultDataPointColor = powerbi.DataViewObjects.getFillColor(objects, columnChartProps.dataPoint.defaultColor), 
        objectProperties.defaultCategoryColor = powerbi.DataViewObjects.getFillColor(objects, columnChartProps.dataPoint.defaultCategoryColor);
        var labelsObj = objects.categoryLabels;
        labelsObj && dataLabelsSettings && LabelUtils.updateLabelSettingsFromLabelsObject(labelsObj, dataLabelsSettings);
        var hasGradient = !1;
        return hasGradient = readMatrix ? dataView && GradientUtils.hasGradientRoleInMatrix(dataView.matrix) : dataView && GradientUtils.hasGradientRole(dataView.categorical), 
        objectProperties.fillPoint = powerbi.DataViewObjects.getValue(objects, scatterChartProps.fillPoint.show, hasGradient), 
        objectProperties.colorBorder = powerbi.DataViewObjects.getValue(objects, scatterChartProps.colorBorder.show, !1), 
        objectProperties.colorByCategory = powerbi.DataViewObjects.getValue(objects, scatterChartProps.colorByCategory.show, !1), 
        objectProperties.bubbleSizeMultiplier = shapeUtil.getBubbleSizeMultiplier(powerbi.DataViewObjects.getValue(objects, scatterChartProps.bubbles.bubbleSize)), 
        objectProperties.markerShape = powerbi.DataViewObjects.getValue(objects, scatterChartProps.bubbles.markerShape, visuals.markerShape.circle), 
        objectProperties.plotAreaShadingSettings = {
            show: powerbi.DataViewObjects.getValue(objects, scatterChartProps.plotAreaShading.show, ScatterChart.DefaultPlotAreaShadingSettings.show),
            upperShadingColor: powerbi.DataViewObjects.getValue(objects, scatterChartProps.plotAreaShading.upperShadingColor, ScatterChart.DefaultPlotAreaShadingSettings.upperShadingColor),
            lowerShadingColor: powerbi.DataViewObjects.getValue(objects, scatterChartProps.plotAreaShading.lowerShadingColor, ScatterChart.DefaultPlotAreaShadingSettings.lowerShadingColor),
            transparency: powerbi.DataViewObjects.getValue(objects, scatterChartProps.plotAreaShading.transparency, ScatterChart.DefaultPlotAreaShadingSettings.transparency)
        }, objectProperties.ratioLineSettings = {
            show: powerbi.DataViewObjects.getValue(objects, scatterChartProps.ratioLine.show, CartesianHelper.DefaultScatterRatioLineSettings.show),
            lineColor: powerbi.DataViewObjects.getValue(objects, scatterChartProps.ratioLine.lineColor, CartesianHelper.DefaultScatterRatioLineSettings.lineColor),
            transparency: powerbi.DataViewObjects.getValue(objects, scatterChartProps.ratioLine.transparency, CartesianHelper.DefaultScatterRatioLineSettings.transparency),
            style: powerbi.DataViewObjects.getValue(objects, scatterChartProps.ratioLine.style, CartesianHelper.DefaultScatterRatioLineSettings.style)
        }, objectProperties.dataVolume = powerbi.DataViewObjects.getValue(objects, scatterChartProps.general.dataVolume, ScatterChart.DefaultDataVolume), 
        objectProperties;
    }
    function getMetadata(grouped, source) {
        var xCol, yCol, sizeCol, xIndex = DataRoleHelper.getMeasureIndexOfRole(grouped, "X"), yIndex = DataRoleHelper.getMeasureIndexOfRole(grouped, "Y"), sizeIndex = DataRoleHelper.getMeasureIndexOfRole(grouped, "Size"), xAxisLabel = "", yAxisLabel = "";
        if (grouped && grouped.length) {
            var firstGroup = grouped[0];
            xIndex >= 0 && (xCol = firstGroup.values[xIndex].source, xAxisLabel = firstGroup.values[xIndex].source.displayName), 
            yIndex >= 0 && (yCol = firstGroup.values[yIndex].source, yAxisLabel = firstGroup.values[yIndex].source.displayName), 
            sizeIndex >= 0 && (sizeCol = firstGroup.values[sizeIndex].source);
        }
        return {
            idx: {
                x: xIndex,
                y: yIndex,
                size: sizeIndex
            },
            cols: {
                x: xCol,
                y: yCol,
                size: sizeCol
            },
            axesLabels: {
                x: xAxisLabel,
                y: yAxisLabel
            }
        };
    }
    function getMetadataFromMatrixDataView(dataView) {
        var xCol, yCol, sizeCol, matrix = dataView.matrix, valueSources = matrix.valueSources, xIndex = _.findIndex(valueSources, function(source) {
            return DataRoleHelper.hasRole(source, "X");
        }), yIndex = _.findIndex(valueSources, function(source) {
            return DataRoleHelper.hasRole(source, "Y");
        }), sizeIndex = _.findIndex(valueSources, function(source) {
            return DataRoleHelper.hasRole(source, "Size");
        }), xAxisLabel = "", yAxisLabel = "";
        return xIndex >= 0 && (xCol = valueSources[xIndex], xAxisLabel = xCol.displayName), 
        yIndex >= 0 && (yCol = valueSources[yIndex], yAxisLabel = yCol.displayName), sizeIndex >= 0 && (sizeCol = valueSources[sizeIndex]), 
        {
            idx: {
                x: xIndex,
                y: yIndex,
                size: sizeIndex
            },
            cols: {
                x: xCol,
                y: yCol,
                size: sizeCol
            },
            axesLabels: {
                x: xAxisLabel,
                y: yAxisLabel
            }
        };
    }
    var data = powerbi.data, visuals = powerbi.visuals, AxisHelper = visuals.AxisHelper, CartesianHelper = powerbi.visuals.CartesianHelper, CategoricalLazyTooltipBuilder = visuals.CategoricalLazyTooltipBuilder, columnChartProps = visuals.columnChartProps, DataRoleHelper = data.DataRoleHelper, DataViewConcatenateUtil = visuals.DataViewConcatenateUtil, DataViewMetadataColumnUtils = data.DataViewMetadataColumnUtils, DataViewObjects = powerbi.DataViewObjects, FormattingStrategies = visuals.FormattingStrategies, GradientUtils = visuals.GradientUtils, LabelUtils = visuals.LabelUtils, Legend = visuals.Legend, ScatterChart = visuals.ScatterChart, scatterChartProps = visuals.scatterChartProps, scatterRoleNames = visuals.scatterRoleNames, SelectionIdBuilder = visuals.SelectionIdBuilder, shapeUtil = visuals.shapeUtil, valueFormatter = visuals.valueFormatter, ValueType = powerbi.ValueType;
    return {
        scatterConverter: function(dataView, options, playFrameInfo, subtotals) {
            return converter(dataView, options, playFrameInfo, subtotals);
        }
    };
}), powerbi.define("PowerBIVisuals/visuals/scatter/scatterChart.render", function(imports) {
    function styleException(elementStyle, seriesStyle) {
        if (seriesStyle) for (var name_1 in elementStyle) elementStyle[name_1] === seriesStyle[name_1] && (elementStyle[name_1] = null);
    }
    function applyStyle(element, style) {
        for (var name_2 in style) {
            var elementValue = element.style[name_2], styleValue = style[name_2];
            if (null == styleValue) {
                if ("" === elementValue) continue;
            } else if (styleValue = styleValue.toString(), styleValue === elementValue) continue;
            element.style[name_2] = styleValue;
        }
    }
    var visuals = powerbi.visuals, CartesianHelper = visuals.CartesianHelper, createClassAndSelector = jsCommon.CssConstants.createClassAndSelector, LineStyle = visuals.LineStyle, PlayChart = visuals.PlayChart, ScatterChart = visuals.ScatterChart, SVGUtil = visuals.SVGUtil, ScatterMarker = createClassAndSelector("scatterMarker"), MainGraphicsContext = createClassAndSelector("mainGraphicsContext"), ScatterMarkerSeriesGroup = createClassAndSelector("scatterMarkerSeriesGroup"), PlotAreaShadingLayerClassSelector = createClassAndSelector("plotAreaShadingLayer"), UpperShadingAreaClassSelector = createClassAndSelector("upperShadingArea"), LowerShadingAreaClassSelector = createClassAndSelector("lowerShadingArea"), RatioLineLayerClassSelector = createClassAndSelector("ratioLineLayer"), RatioLineClassSelector = createClassAndSelector("ratioLine"), ScatterChartRenderer = function() {
        function ScatterChartRenderer() {}
        return ScatterChartRenderer.prototype.init = function(element, labelsContext, isMobileChart, tooltipsEnabled, tooltipService) {
            this.axisGraphicsContext = element, this.mainGraphicsG = element.append("g").classed(MainGraphicsContext.class, !0), 
            this.isMobileChart = isMobileChart, isMobileChart && (this.mainGraphicsBackgroundRect = this.mainGraphicsG.append("rect").classed("backgroundRect", !0).attr({
                width: "100%",
                height: "100%"
            })), this.mainGraphicsContext = this.mainGraphicsG.append("svg"), this.labelGraphicsContext = labelsContext, 
            this.tooltipsEnabled = tooltipsEnabled, this.tooltipService = tooltipService, this.mainGraphicsContext.attr("stroke-width", "1");
        }, ScatterChartRenderer.prototype.markersHaveChanged = function(viewModel) {
            var currentMarkers = _.map(viewModel.data.dataPointSeries, function(series) {
                return series.markerShape;
            }), previousMarkers = this.previousMarkers;
            if (!previousMarkers) return this.previousMarkers = currentMarkers, !1;
            for (var i = 0, ilen = Math.min(currentMarkers.length, previousMarkers.length); i < ilen; i++) if (currentMarkers[i] !== previousMarkers[i]) return this.previousMarkers = currentMarkers, 
            !0;
            return this.previousMarkers = currentMarkers, !1;
        }, ScatterChartRenderer.prototype.render = function(viewModel, interactivityService) {
            var plotArea = viewModel.plotArea;
            this.mainGraphicsContext.attr({
                width: plotArea.width,
                height: plotArea.height
            }), this.drawRatioLine(viewModel), this.drawShadedBackground(viewModel);
            var scatterMarkers;
            return scatterMarkers = viewModel.suppressDataPointRendering ? this.removeScatterMarkers() : viewModel.animationDuration > 0 && !this.markersHaveChanged(viewModel) ? this.drawScatterMarkers(viewModel) : this.drawScatterMarkersNoAnimation(viewModel, viewModel.drawBubbles), 
            viewModel.drawBubbles && scatterMarkers.order(), this.tooltipsEnabled && this.tooltipService.addTooltip(this.mainGraphicsContext, function(args) {
                return args.data && args.data.tooltipInfo();
            }, function(args) {
                return args.data && args.data.identity;
            }), SVGUtil.flushAllD3TransitionsIfNeeded(viewModel.animationOptions), {
                dataPointsSelection: scatterMarkers,
                eventGroup: this.mainGraphicsG,
                data: viewModel.data,
                plotContext: this.mainGraphicsContext
            };
        }, ScatterChartRenderer.prototype.createTraceLineRenderer = function(viewModel) {
            return new ScatterTraceLineRenderer(viewModel, this.mainGraphicsContext, this.tooltipsEnabled, this.tooltipService);
        }, ScatterChartRenderer.prototype.drawShadedBackground = function(viewModel) {
            var settings = viewModel.data.plotAreaShadingSettings || ScatterChart.DefaultPlotAreaShadingSettings, layer = this.axisGraphicsContext.select(PlotAreaShadingLayerClassSelector.selector);
            if (!settings.show) return void (layer.empty() || layer.remove());
            layer.empty() && (layer = this.axisGraphicsContext.insert("svg", ":first-child").classed(PlotAreaShadingLayerClassSelector.class, !0)), 
            layer.attr({
                height: viewModel.plotArea.height,
                width: viewModel.plotArea.width
            });
            var xScale = viewModel.xAxisProperties.scale, yScale = viewModel.yAxisProperties.scale, xDomain = xScale.domain(), yDomain = yScale.domain(), domain = [ Math.min(xDomain[0], yDomain[0]), Math.max(xDomain[1], yDomain[1]) ], lineData = [ {
                x: xScale(domain[0]),
                y: yScale(domain[0])
            }, {
                x: xScale(domain[1]),
                y: yScale(domain[1])
            } ], upperAreaData = settings.show ? [ [ {
                x: lineData[0].x,
                y: lineData[0].y
            }, {
                x: lineData[0].x,
                y: lineData[1].y
            } ], [ {
                x: lineData[1].x,
                y: lineData[1].y
            }, {
                x: lineData[1].x,
                y: lineData[1].y
            } ] ] : [];
            this.drawArea(UpperShadingAreaClassSelector, layer, upperAreaData, settings.upperShadingColor, settings.transparency);
            var lowerAreaData = settings.show ? [ [ {
                x: lineData[0].x,
                y: lineData[0].y
            }, {
                x: lineData[0].x,
                y: lineData[0].y
            } ], [ {
                x: lineData[1].x,
                y: lineData[0].y
            }, {
                x: lineData[1].x,
                y: lineData[1].y
            } ] ] : [];
            this.drawArea(LowerShadingAreaClassSelector, layer, lowerAreaData, settings.lowerShadingColor, settings.transparency);
        }, ScatterChartRenderer.prototype.drawRatioLine = function(viewModel) {
            var settings = viewModel.data.ratioLineSettings || CartesianHelper.DefaultScatterRatioLineSettings, layer = this.axisGraphicsContext.select(RatioLineLayerClassSelector.selector);
            if (!settings.show) return void (layer.empty() || layer.remove());
            layer.empty() && (layer = this.axisGraphicsContext.append("svg").classed(RatioLineLayerClassSelector.class, !0)), 
            layer.attr({
                height: viewModel.plotArea.height,
                width: viewModel.plotArea.width
            });
            var xScale = viewModel.xAxisProperties.scale, yScale = viewModel.yAxisProperties.scale, xDomain = xScale.domain(), yDomain = yScale.domain(), xTotal = viewModel.data.xSubtotal, yTotal = viewModel.data.ySubtotal, data = [];
            if (settings.show && _.isFinite(xTotal) && _.isFinite(yTotal)) if (0 !== xTotal && 0 !== yTotal) {
                var slope = yTotal / xTotal;
                data = [ {
                    x: xScale(xDomain[0]),
                    y: yScale(xDomain[0] * slope)
                }, {
                    x: xScale(xDomain[1]),
                    y: yScale(xDomain[1] * slope)
                } ];
            } else 0 !== yTotal ? data = [ {
                x: xScale(0),
                y: yScale(yDomain[0])
            }, {
                x: xScale(0),
                y: yScale(yDomain[1])
            } ] : 0 !== xTotal && (data = [ {
                x: xScale(xDomain[0]),
                y: yScale(0)
            }, {
                x: xScale(xDomain[1]),
                y: yScale(0)
            } ]);
            this.drawLine(RatioLineClassSelector, layer, data, settings);
        }, ScatterChartRenderer.prototype.removeScatterMarkers = function() {
            return this.mainGraphicsContext.selectAll(ScatterMarkerSeriesGroup.selector).remove(), 
            this.mainGraphicsContext.selectAll(ScatterMarker.selector);
        }, ScatterChartRenderer.prototype.drawScatterMarkers = function(viewModel) {
            var data = viewModel.data, xScale = viewModel.xAxisProperties.scale, yScale = viewModel.yAxisProperties.scale, fakeDataPointSeries = [ {
                identityKey: "",
                dataPoints: data.dataPoints
            } ], fakeSeriesGroups = this.mainGraphicsContext.selectAll(ScatterMarkerSeriesGroup.selector).data(fakeDataPointSeries, function(s) {
                return s.identityKey;
            });
            fakeSeriesGroups.enter().append("g").classed(ScatterMarkerSeriesGroup.class, !0), 
            fakeSeriesGroups.exit().remove();
            var markers = fakeSeriesGroups.selectAll(ScatterMarker.selector).data(function(s) {
                return s.dataPoints;
            }, function(d) {
                return d.identity.getKey();
            });
            return markers.enter().append("path").classed(ScatterMarker.class, !0).style("opacity", 0).attr({
                transform: function(d) {
                    return SVGUtil.translate(xScale(d.x), yScale(d.y));
                }
            }), markers.style({
                "stroke-opacity": function(d) {
                    return ScatterChart.getMarkerStrokeOpacity(null != d.size, data.colorBorder, viewModel.hasSelection, d.selected);
                },
                stroke: function(d) {
                    return ScatterChart.getStrokeFill(d, data.colorBorder);
                },
                fill: function(d) {
                    return d.fill;
                },
                "fill-opacity": function(d) {
                    return ScatterChart.getMarkerFillOpacity(null != d.size, viewModel.fillMarkers, viewModel.hasSelection, d.selected);
                }
            }).transition().ease(viewModel.easeType).duration(viewModel.animationDuration).style("opacity", 1).attr({
                d: function(d) {
                    return powerbi.visuals.Markers.getPathWithRadius(d.markerShape, CartesianHelper.getBubbleRadius(d.radius, data.sizeRange, viewModel.plotArea, data.multiplier));
                },
                transform: function(d) {
                    return SVGUtil.translate(xScale(d.x), yScale(d.y));
                }
            }), markers.exit().transition().ease(viewModel.easeType).duration(viewModel.animationDuration).style("opacity", 0).attr("r", 0).remove(), 
            markers;
        }, ScatterChartRenderer.prototype.drawScatterMarkersNoAnimation = function(viewModel, isBubble) {
            var seriesGroups, data = viewModel.data, xScale = viewModel.xAxisProperties.scale, yScale = viewModel.yAxisProperties.scale;
            if (isBubble) {
                var fakeDataPointSeries = [ {
                    identityKey: "",
                    dataPoints: data.dataPoints
                } ];
                seriesGroups = this.mainGraphicsContext.selectAll(ScatterMarkerSeriesGroup.selector).data(fakeDataPointSeries, function(s) {
                    return s.identityKey;
                });
            } else seriesGroups = this.mainGraphicsContext.selectAll(ScatterMarkerSeriesGroup.selector).data(data.dataPointSeries, function(s) {
                return s.identityKey;
            });
            return seriesGroups.enter().append("g").classed(ScatterMarkerSeriesGroup.class, !0), 
            seriesGroups.exit().remove(), seriesGroups.each(function(s) {
                var seriesStyle = ScatterChart.getSeriesStyle(s.hasSize, data.colorBorder, viewModel.hasSelection, viewModel.fillMarkers, s.fill), g = d3.select(this);
                applyStyle(this, seriesStyle);
                var markers = g.selectAll(ScatterMarker.selector).data(s.dataPoints, function(m) {
                    return m.identity.getKey();
                });
                markers.interrupt(), markers.enter().append("path").classed(ScatterMarker.class, !0), 
                markers.exit().remove(), markers.each(function(d) {
                    var style = ScatterChart.getMarkerStyle(d, data.colorBorder, viewModel.hasSelection, viewModel.fillMarkers);
                    styleException(style, seriesStyle), applyStyle(this, style);
                }), markers.attr({
                    d: function(d) {
                        return powerbi.visuals.Markers.getPathWithRadius(d.markerShape, CartesianHelper.getBubbleRadius(d.radius, data.sizeRange, viewModel.plotArea, data.multiplier));
                    },
                    transform: function(d) {
                        return SVGUtil.translate(xScale(d.x), yScale(d.y));
                    }
                }).style("opacity", null);
            }), this.mainGraphicsContext.selectAll(ScatterMarker.selector);
        }, ScatterChartRenderer.prototype.drawLine = function(lineClassAndSelector, layer, data, settings) {
            var style = {};
            style.stroke = settings.lineColor.solid.color, style["stroke-width"] = 2, style["stroke-opacity"] = (100 - settings.transparency) / 100, 
            style["stroke-dasharray"] = LineStyle.getStrokeDashArrayFromLineStyle(settings.style), 
            style["stroke-linecap"] = LineStyle.getStrokeLineCapFromLineStyle(settings.style), 
            style.fill = "none", style["stroke-width"] = "3px";
            var pathGen = d3.svg.line().x(function(point) {
                return point.x;
            }).y(function(point) {
                return point.y;
            }), line = layer.selectAll(lineClassAndSelector.selector).data([ data ]);
            return line.enter().append("path").classed(lineClassAndSelector.class, !0), line.attr("d", function(d) {
                return pathGen(d);
            }).style(style), line.exit().remove(), layer;
        }, ScatterChartRenderer.prototype.drawArea = function(areaClassAndSelector, layer, data, fill, transparency) {
            var pathGen = d3.svg.area().x0(function(point) {
                return point[0].x;
            }).y0(function(point) {
                return point[0].y;
            }).x1(function(point) {
                return point[1].x;
            }).y1(function(point) {
                return point[1].y;
            }), area = layer.selectAll(areaClassAndSelector.selector).data([ data ]);
            area.enter().append("path").classed(areaClassAndSelector.class, !0), area.attr("d", function(d) {
                return pathGen(d);
            }).style({
                fill: fill.solid.color,
                "fill-opacity": (100 - transparency) / 100
            }), area.exit().remove();
        }, ScatterChartRenderer;
    }(), TraceLine = createClassAndSelector("traceLine"), TraceBubble = createClassAndSelector("traceBubble"), ScatterTraceLineRenderer = function() {
        function ScatterTraceLineRenderer(viewModel, element, tooltipsEnabled, tooltipService) {
            this.viewModel = viewModel, this.element = element, this.tooltipsEnabled = tooltipsEnabled, 
            this.tooltipService = tooltipService;
        }
        return ScatterTraceLineRenderer.prototype.remove = function() {
            this.element.selectAll(TraceLine.selector).remove(), this.element.selectAll(TraceBubble.selector).remove();
        }, ScatterTraceLineRenderer.prototype.render = function(selectedPoints, shouldAnimate) {
            var viewModel = this.viewModel, currentViewModel = viewModel.data.currentViewModel, scatterViewModel = viewModel.viewModel, seriesPoints = [];
            if (_.isEmpty(selectedPoints) || scatterViewModel.suppressDataPointRendering) this.remove(); else {
                for (var currentFrameIndex_1 = viewModel.data.currentFrameIndex, hasBubbleAtCurrentFrame = [], selectedIndex = 0, selectedLen = selectedPoints.length; selectedIndex < selectedLen; selectedIndex++) {
                    seriesPoints[selectedIndex] = [], hasBubbleAtCurrentFrame[selectedIndex] = !1;
                    for (var frameIndex = 0, frameLen = viewModel.data.allViewModels.length; frameIndex < frameLen && frameIndex <= currentFrameIndex_1; frameIndex++) {
                        var value = _.find(viewModel.data.allViewModels[frameIndex].dataPoints, function(value, index) {
                            return value.identity.getKey() === selectedPoints[selectedIndex].identity.getKey();
                        });
                        null != value && (value.frameIndex = frameIndex, seriesPoints[selectedIndex].push(value), 
                        frameIndex === currentFrameIndex_1 && (hasBubbleAtCurrentFrame[selectedIndex] = !0));
                    }
                }
                var xScale_1 = scatterViewModel.xAxisProperties.scale, yScale_1 = scatterViewModel.yAxisProperties.scale, line_1 = d3.svg.line().x(function(d) {
                    return xScale_1(d.x);
                }).y(function(d) {
                    return yScale_1(d.y);
                }).defined(function(d) {
                    return null !== d.x && null !== d.y;
                }), traceLines = this.element.selectAll(TraceLine.selector).data(selectedPoints, function(sp) {
                    return sp.identity.getKey();
                });
                traceLines.enter().append("path").classed(TraceLine.class, !0);
                var previousLengths_1 = [], newLengths_1 = [], reverse_1 = !1;
                traceLines.each(function(d, i) {
                    var existingPath = this, previousLength = existingPath.hasAttribute("d") ? existingPath.getTotalLength() : 0;
                    previousLengths_1.push(previousLength);
                    var tempSvgPath = $("<svg><path></path></svg>"), tempPath = $("path", tempSvgPath);
                    tempPath.attr("d", line_1(seriesPoints[i]));
                    var newLength = seriesPoints[i].length > 0 ? tempPath.get()[0].getTotalLength() : 0;
                    newLengths_1.push(newLength), reverse_1 = reverse_1 || newLength < previousLength;
                }), reverse_1 ? shouldAnimate ? traceLines.transition().ease("linear").duration(PlayChart.FrameAnimationDuration).attr("stroke-dashoffset", function(d, i) {
                    return previousLengths_1[i] - newLengths_1[i];
                }).transition().ease("linear").duration(1).delay(PlayChart.FrameAnimationDuration).style("stroke", function(d) {
                    return ScatterChart.getStrokeFill(d, !0);
                }).attr({
                    d: function(d, i) {
                        return line_1(seriesPoints[i]);
                    },
                    "stroke-dasharray": function(d, i) {
                        return newLengths_1[i] + " " + newLengths_1[i];
                    },
                    "stroke-dashoffset": 0
                }) : traceLines.style("stroke", function(d) {
                    return ScatterChart.getStrokeFill(d, !0);
                }).attr({
                    d: function(d, i) {
                        return line_1(seriesPoints[i]);
                    },
                    "stroke-dasharray": function(d, i) {
                        return newLengths_1[i] + " " + newLengths_1[i];
                    },
                    "stroke-dashoffset": 0
                }) : (traceLines.style("stroke", function(d) {
                    return ScatterChart.getStrokeFill(d, !0);
                }).attr({
                    d: function(d, i) {
                        return line_1(seriesPoints[i]);
                    },
                    "stroke-dasharray": function(d, i) {
                        return newLengths_1[i] + " " + newLengths_1[i];
                    },
                    "stroke-dashoffset": function(d, i) {
                        return newLengths_1[i] - previousLengths_1[i];
                    }
                }), shouldAnimate ? traceLines.transition().ease("linear").duration(PlayChart.FrameAnimationDuration).attr("stroke-dashoffset", 0) : traceLines.attr("stroke-dashoffset", 0)), 
                traceLines.exit().remove();
                for (var circlePoints = [], selectedIndex_1 = 0; selectedIndex_1 < seriesPoints.length; selectedIndex_1++) {
                    var points = seriesPoints[selectedIndex_1], newPoints = hasBubbleAtCurrentFrame[selectedIndex_1] ? points.slice(0, points.length - 1) : points;
                    circlePoints = circlePoints.concat(newPoints);
                }
                var circles = this.element.selectAll(TraceBubble.selector).data(circlePoints, function(d) {
                    return d.identity.getKey() + d.x + d.y + d.size;
                });
                circles.enter().append("circle").style("opacity", 0).classed(TraceBubble.class, !0), 
                circles.attr("cx", function(d) {
                    return xScale_1(d.x);
                }).attr("cy", function(d) {
                    return yScale_1(d.y);
                }).attr("r", function(d) {
                    return CartesianHelper.getBubbleRadius(d.radius, currentViewModel.sizeRange, scatterViewModel.plotArea, currentViewModel.multiplier);
                }).style({
                    "stroke-opacity": function(d) {
                        return ScatterChart.getBubbleOpacity(d, !0);
                    },
                    stroke: function(d) {
                        return ScatterChart.getStrokeFill(d, currentViewModel.colorBorder);
                    },
                    fill: function(d) {
                        return d.fill;
                    },
                    "fill-opacity": function(d) {
                        return null != d.size ? .2 + d.frameIndex / currentFrameIndex_1 * .6 : 0;
                    }
                }).transition().ease("linear").duration(PlayChart.FrameAnimationDuration).style("opacity", 1), 
                circles.exit().transition().ease("linear").duration(PlayChart.FrameAnimationDuration).style("opacity", 0).remove(), 
                this.tooltipsEnabled && this.tooltipService.addTooltip(circles, function(args) {
                    return args.data && args.data.tooltipInfo();
                }, function(args) {
                    return args.data && args.data.identity;
                }), circles.sort(function(d1, d2) {
                    return d2.size - d1.size;
                });
            }
        }, ScatterTraceLineRenderer;
    }();
    return {
        create: function() {
            return new ScatterChartRenderer();
        }
    };
});

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var Color = jsCommon.Color, ScatterChart = function() {
            function ScatterChart(options) {
                options && (this.tooltipsEnabled = options.tooltipsEnabled, this.interactivityService = options.interactivityService, 
                this.animator = options.animator, this.scatterWithMatrixDV = options.featureSwitches.scatterWithMatrixDV, 
                this.scatterWithDataVolume = options.featureSwitches.scatterWithDataVolume), this.renderer = powerbi.requireSync("PowerBIVisuals/visuals/scatter/scatterChart.render").create();
            }
            return ScatterChart.prototype.init = function(options) {
                this.options = options, this.element = options.element, this.currentViewport = options.viewport, 
                this.style = options.style, this.host = options.host, this.colors = this.style.colorPalette.dataColors, 
                this.interactivity = options.interactivity, this.cartesianVisualHost = options.cartesianHost, 
                this.isMobileChart = options.interactivity && options.interactivity.isInteractiveLegend, 
                this.tooltipService = options.services.tooltips;
                var svg = this.svg = options.svg;
                svg.classed(ScatterChart.ClassName + " " + visuals.PlayChart.ClassName, !0), this.renderer.init(svg, options.labelsContext, this.isMobileChart, this.tooltipsEnabled, this.tooltipService), 
                ScatterChart.DefaultPlotAreaShadingSettings.upperShadingColor = {
                    solid: {
                        color: this.colors.getColorByIndex(3).value
                    }
                }, ScatterChart.DefaultPlotAreaShadingSettings.lowerShadingColor = {
                    solid: {
                        color: this.colors.getColorByIndex(5).value
                    }
                };
            }, ScatterChart.createLazyFormattedCategory = function(formatter, value) {
                return new jsCommon.Lazy(function() {
                    return formatter.format(value);
                });
            }, ScatterChart.createLazyFormattedLazyValue = function(formatter, value) {
                return new jsCommon.Lazy(function() {
                    return formatter.format(value());
                });
            }, ScatterChart.getMeasureValue = function(measureIndex, seriesValues) {
                return measureIndex >= 0 ? seriesValues[measureIndex] : null;
            }, ScatterChart.getDefaultData = function() {
                return {
                    xCol: void 0,
                    yCol: void 0,
                    dataPoints: [],
                    dataPointSeries: [],
                    legendData: visuals.Legend.getDefaultLegendData(),
                    axesLabels: {
                        x: "",
                        y: ""
                    },
                    sizeRange: {
                        min: void 0,
                        max: void 0
                    },
                    dataLabelsSettings: visuals.LabelUtils.getDefaultPointLabelSettings(),
                    hasDynamicSeries: !1,
                    plotAreaShadingSettings: ScatterChart.DefaultPlotAreaShadingSettings,
                    ratioLineSettings: visuals.CartesianHelper.DefaultScatterRatioLineSettings,
                    markerShape: visuals.markerShape.circle,
                    dataVolume: ScatterChart.DefaultDataVolume
                };
            }, ScatterChart.prototype.renderAtFrame = function(data) {
                this.data = data, this.cartesianVisualHost.triggerRender(!1);
            }, ScatterChart.prototype.setData = function(dataViews) {
                var _this = this;
                if (this.data = ScatterChart.getDefaultData(), this.playAxis && this.playAxis.isCurrentlyPlaying() && this.playAxis.stop(), 
                dataViews.length > 0) {
                    var dataView = dataViews[0] || dataViews[1];
                    if (dataView) {
                        this.categoryAxisProperties = visuals.CartesianHelper.getCategoryAxisProperties(dataView.metadata, !0), 
                        this.valueAxisProperties = visuals.CartesianHelper.getValueAxisProperties(dataView.metadata, !0), 
                        this.dataView = dataView;
                        var converterOptions_1 = {
                            viewport: this.currentViewport,
                            colors: this.colors,
                            interactivityService: this.interactivityService,
                            categoryAxisProperties: this.categoryAxisProperties,
                            valueAxisProperties: this.valueAxisProperties,
                            style: this.style,
                            tooltipsEnabled: this.tooltipsEnabled,
                            useMatrixDV: this.scatterWithMatrixDV
                        }, scatterConverter_1 = powerbi.requireSync("PowerBIVisuals/visuals/scatter/scatterChart.converter");
                        if (visuals.PlayChart.isDataViewPlayable(dataView)) {
                            this.playAxis || (this.playAxis = new visuals.PlayAxis({
                                animator: this.animator,
                                interactivityService: this.interactivityService,
                                isScrollable: !1,
                                featureSwitches: {}
                            }), this.playAxis.init(this.options)), converterOptions_1.useMatrixDV = !1;
                            var playData = this.playAxis.setData(dataView, function(dataView, playFrameInfo, subtotals) {
                                return scatterConverter_1.scatterConverter(dataView, converterOptions_1, playFrameInfo, subtotals);
                            });
                            this.mergeSizeRanges(playData), this.data = playData.currentViewModel, this.playAxis.setRenderFunction(function(data) {
                                return _this.renderAtFrame(data);
                            });
                        } else {
                            this.playAxis && (this.playAxis.remove(), this.playAxis = null);
                            var data_4 = scatterConverter_1.scatterConverter(dataView, converterOptions_1);
                            data_4 && (this.data = data_4);
                        }
                    }
                } else this.playAxis && (this.playAxis.remove(), this.playAxis = null);
            }, ScatterChart.prototype.mergeSizeRanges = function(playData) {
                if (playData && playData.currentViewModel) {
                    for (var mergedSizeRange = playData.currentViewModel.sizeRange, _i = 0, _a = playData.allViewModels; _i < _a.length; _i++) {
                        var data_5 = _a[_i], sizeRange = data_5.sizeRange;
                        null != sizeRange.min && (mergedSizeRange.min = Math.min(mergedSizeRange.min, sizeRange.min)), 
                        null != sizeRange.max && (mergedSizeRange.max = Math.max(mergedSizeRange.max, sizeRange.max));
                    }
                    for (var _b = 0, _c = playData.allViewModels; _b < _c.length; _b++) {
                        var data_6 = _c[_b];
                        data_6.sizeRange = mergedSizeRange;
                    }
                }
            }, ScatterChart.prototype.calculateLegend = function() {
                return this.data && this.data.legendData;
            }, ScatterChart.prototype.calculateCustomLegend = function() {
                return this.data && this.data.legendData;
            }, ScatterChart.prototype.hasLegend = function() {
                return this.data && this.data.hasDynamicSeries;
            }, ScatterChart.prototype.enumerateObjectInstances = function(enumeration, options) {
                switch (options.objectName) {
                  case "colorByCategory":
                    this.data && (this.data.hasDynamicSeries || enumeration.pushInstance({
                        objectName: "colorByCategory",
                        selector: null,
                        properties: {
                            show: this.data.colorByCategory
                        }
                    }));
                    break;

                  case "dataPoint":
                    if (!this.playAxis && this.dataView && (this.scatterWithMatrixDV && !visuals.GradientUtils.hasGradientRoleInMatrix(this.dataView.matrix) || !this.scatterWithMatrixDV && !visuals.GradientUtils.hasGradientRole(this.dataView.categorical))) return this.enumerateDataPoints(enumeration);
                    break;

                  case "categoryAxis":
                    enumeration.pushInstance({
                        selector: null,
                        properties: {
                            showAxisTitle: !this.categoryAxisProperties || null == this.categoryAxisProperties.showAxisTitle || this.categoryAxisProperties.showAxisTitle
                        },
                        objectName: "categoryAxis"
                    });
                    break;

                  case "valueAxis":
                    enumeration.pushInstance({
                        selector: null,
                        properties: {
                            showAxisTitle: !this.valueAxisProperties || null == this.valueAxisProperties.showAxisTitle || this.valueAxisProperties.showAxisTitle
                        },
                        objectName: "valueAxis"
                    });
                    break;

                  case "categoryLabels":
                    this.data ? visuals.LabelUtils.enumerateCategoryLabels(enumeration, this.data.dataLabelsSettings, !0) : visuals.LabelUtils.enumerateCategoryLabels(enumeration, null, !0);
                    break;

                  case "fillPoint":
                    if (this.data.hasSize) return;
                    enumeration.pushInstance({
                        objectName: "fillPoint",
                        selector: null,
                        properties: {
                            show: this.data.fillPoint
                        }
                    });
                    break;

                  case "colorBorder":
                    this.data.hasSize && enumeration.pushInstance({
                        objectName: "colorBorder",
                        selector: null,
                        properties: {
                            show: this.data.colorBorder
                        }
                    });
                    break;

                  case "bubbles":
                    ScatterChart.enumerateBubbles(enumeration, this.data, this.dataView);
                    break;

                  case "plotAreaShading":
                    enumeration.pushInstance({
                        selector: null,
                        objectName: "plotAreaShading",
                        properties: {
                            show: this.data.plotAreaShadingSettings.show,
                            upperShadingColor: this.data.plotAreaShadingSettings.upperShadingColor,
                            lowerShadingColor: this.data.plotAreaShadingSettings.lowerShadingColor,
                            transparency: this.data.plotAreaShadingSettings.transparency
                        }
                    });
                    break;

                  case "ratioLine":
                    enumeration.pushInstance({
                        selector: null,
                        objectName: "ratioLine",
                        properties: {
                            show: this.data.ratioLineSettings.show,
                            lineColor: this.data.ratioLineSettings.lineColor,
                            transparency: this.data.ratioLineSettings.transparency,
                            style: this.data.ratioLineSettings.style
                        }
                    });
                    break;

                  case "general":
                    this.data && !this.playAxis && this.scatterWithDataVolume && enumeration.pushInstance({
                        selector: null,
                        objectName: "general",
                        properties: {
                            dataVolume: this.data.dataVolume
                        },
                        validValues: {
                            dataVolume: {
                                numberRange: {
                                    min: ScatterChart.DefaultDataVolume,
                                    max: ScatterChart.MaximumDataVolume
                                }
                            }
                        }
                    });
                }
            }, ScatterChart.prototype.enumerateDataPoints = function(enumeration) {
                var data = this.data;
                data && (data.hasDynamicSeries ? powerbi.requireSync("PowerBIVisuals/Visuals/common/colorEnumerationHelper").enumerateSeriesDataColors({
                    enumeration: enumeration,
                    dataPoints: visuals.LegendData.toIEnumerableDataPoints(data.legendData)
                }) : powerbi.requireSync("PowerBIVisuals/Visuals/common/colorEnumerationHelper").enumerateCategoryDataColors({
                    enumeration: enumeration,
                    dataView: this.dataView,
                    style: this.style,
                    dataPoints: _.map(data.dataPoints, function(dataPoint) {
                        return {
                            color: dataPoint.fill,
                            displayName: dataPoint.formattedCategory.getValue(),
                            identity: dataPoint.identity
                        };
                    })
                }));
            }, ScatterChart.enumerateBubbles = function(enumeration, data, dataView) {
                var showSeries;
                data.dataPointSeries.length > 1 && (showSeries = powerbi.DataViewObjects.getValue(dataView && dataView.metadata && dataView.metadata.objects, visuals.scatterChartProps.bubbles.showSeries, !1));
                var instance = {
                    selector: null,
                    properties: {
                        bubbleSize: visuals.shapeUtil.invertBubbleSizeMultiplier(data.multiplier),
                        markerShape: data.markerShape
                    },
                    validValues: {
                        markerShape: [ visuals.markerShape.circle, visuals.markerShape.square, visuals.markerShape.diamond, visuals.markerShape.triangle ]
                    },
                    objectName: visuals.scatterChartProps.bubbles.markerShape.objectName
                };
                if (null != showSeries && (instance.properties[visuals.scatterChartProps.bubbles.showSeries.propertyName] = showSeries), 
                enumeration.pushInstance(instance), showSeries) for (var seriesIndex = 0, seriesCount = data.dataPointSeries.length; seriesIndex < seriesCount; seriesIndex++) {
                    var series = data.dataPointSeries[seriesIndex];
                    enumeration.pushContainer({
                        displayName: series.name
                    }), enumeration.pushInstance({
                        selector: powerbi.data.Selector.normalizeSelector(series.identity.getSelector()),
                        properties: {
                            markerShape: series.markerShape
                        },
                        validValues: {
                            markerShape: [ visuals.markerShape.circle, visuals.markerShape.square, visuals.markerShape.diamond, visuals.markerShape.triangle ]
                        },
                        objectName: visuals.scatterChartProps.bubbles.markerShape.objectName
                    }), enumeration.popContainer();
                }
            }, ScatterChart.prototype.supportsTrendLine = function() {
                var data = this.data;
                if (!data) return !1;
                var dataView = this.dataView;
                if (this.scatterWithMatrixDV) return !this.data.hasSize && !!data.xCol && !!data.yCol && _.size(data.dataPoints) > 0;
                var reader = powerbi.data.createDataViewCategoricalReader(dataView);
                return !this.data.hasSize && data.dataPointSeries.length > 0 && reader.data.hasValues("X") && reader.data.hasValues("Y");
            }, ScatterChart.prototype.getAxisLocationForRole = function(roleName) {
                return "X" === roleName ? 0 : 1;
            }, ScatterChart.getExtents = function(data) {
                var dps = data.dataPoints;
                return _.isEmpty(dps) ? {
                    minY: 0,
                    maxY: 0,
                    minX: 0,
                    maxX: 0
                } : {
                    minY: d3.min(dps, function(d) {
                        return d.y;
                    }),
                    maxY: d3.max(dps, function(d) {
                        return d.y;
                    }),
                    minX: d3.min(dps, function(d) {
                        return d.x;
                    }),
                    maxX: d3.max(dps, function(d) {
                        return d.x;
                    })
                };
            }, ScatterChart.prototype.calculateAxesProperties = function(options) {
                var data = this.data, viewport = this.currentViewport = options.viewport, margin = options.margin;
                this.currentViewport = viewport, this.margin = margin;
                var width = viewport.width - (margin.left + margin.right), height = viewport.height - (margin.top + margin.bottom), extents = {
                    minY: 0,
                    maxY: 10,
                    minX: 0,
                    maxX: 10
                };
                this.playAxis ? (extents = this.playAxis.getCartesianExtents(extents, ScatterChart.getExtents), 
                this.playAxis.setPlayControlPosition(options.playAxisControlLayout)) : _.isEmpty(data.dataPoints) || (extents = ScatterChart.getExtents(data));
                var xDomain = [ extents.minX, extents.maxX ], combinedXDomain = visuals.AxisHelper.combineDomain(options.forcedXDomain, xDomain, options.ensureXDomain);
                this.xAxisProperties = visuals.AxisHelper.createAxis({
                    pixelSpan: width,
                    dataDomain: combinedXDomain,
                    zeroScalarDomain: [ -1, 1 ],
                    metaDataColumn: data.xCol,
                    formatString: visuals.valueFormatter.getFormatString(data.xCol, visuals.scatterChartProps.general.formatString),
                    outerPadding: 0,
                    isScalar: !0,
                    isVertical: !1,
                    forcedTickCount: options.forcedTickCount,
                    useTickIntervalForDisplayUnits: !0,
                    isCategoryAxis: !0,
                    scaleType: options.categoryAxisScaleType,
                    axisDisplayUnits: options.categoryAxisDisplayUnits,
                    axisPrecision: options.categoryAxisPrecision,
                    margin: margin,
                    preventNice: options.preventNiceX
                }), this.xAxisProperties.axis.tickSize(-height, 0), this.xAxisProperties.axisLabel = this.data.axesLabels.x;
                var combinedDomain = visuals.AxisHelper.combineDomain(options.forcedYDomain, [ extents.minY, extents.maxY ], options.ensureYDomain);
                return this.yAxisProperties = visuals.AxisHelper.createAxis({
                    pixelSpan: height,
                    dataDomain: combinedDomain,
                    zeroScalarDomain: [ -1, 1 ],
                    metaDataColumn: data.yCol,
                    formatString: visuals.valueFormatter.getFormatString(data.yCol, visuals.scatterChartProps.general.formatString),
                    outerPadding: 0,
                    isScalar: !0,
                    isVertical: !0,
                    forcedTickCount: options.forcedTickCount,
                    useTickIntervalForDisplayUnits: !0,
                    isCategoryAxis: !1,
                    scaleType: options.valueAxisScaleType,
                    axisDisplayUnits: options.valueAxisDisplayUnits,
                    axisPrecision: options.valueAxisPrecision,
                    margin: margin,
                    preventNice: options.preventNiceY
                }), this.yAxisProperties.axisLabel = this.data.axesLabels.y, [ this.xAxisProperties, this.yAxisProperties ];
            }, ScatterChart.prototype.overrideXScale = function(xProperties) {
                this.xAxisProperties = xProperties;
            }, ScatterChart.prototype.shouldSuppressAnimation = function() {
                return this.data && this.data.dataPoints && this.data.dataPoints.length > ScatterChart.NoAnimationThreshold;
            }, ScatterChart.prototype.categoryAxisTitleOnByDefault = function() {
                return !0;
            }, ScatterChart.prototype.valueAxisTitleOnByDefault = function() {
                return !0;
            }, ScatterChart.prototype.render = function(suppressAnimations, resizeMode) {
                if (this.data) {
                    var data = this.data, margin = this.margin, viewport = this.currentViewport, hasSelection = this.interactivityService && this.interactivityService.hasSelection(), plotArea = {
                        width: viewport.width - (margin.left + margin.right),
                        height: viewport.height - (margin.top + margin.bottom)
                    }, duration = visuals.AnimatorCommon.GetAnimationDuration(this.animator, suppressAnimations);
                    this.playAxis && this.playAxis.isCurrentlyPlaying() && (this.isMobileChart || duration > 0) && (duration = visuals.PlayChart.FrameAnimationDuration);
                    var easeType = this.playAxis ? "linear" : "cubic-in-out", drawBubbles = this.data.hasSize, fillMarkers = !drawBubbles && data.fillPoint, suppressDataPointRendering = 1 === resizeMode && data.dataPoints && data.dataPoints.length > ScatterChart.NoRenderResizeThreshold, viewModel = {
                        data: data,
                        drawBubbles: drawBubbles,
                        isPlay: !!this.playAxis,
                        xAxisProperties: this.xAxisProperties,
                        yAxisProperties: this.yAxisProperties,
                        plotArea: plotArea,
                        hasSelection: hasSelection,
                        animationDuration: duration,
                        animationOptions: this.options.animation,
                        fillMarkers: fillMarkers,
                        easeType: easeType,
                        suppressDataPointRendering: suppressDataPointRendering
                    };
                    if (drawBubbles) {
                        var sortedData = data.dataPoints.sort(ScatterChart.sortBubbles);
                        viewModel.data = powerbi.Prototype.inherit(viewModel.data), viewModel.data.dataPoints = sortedData;
                    }
                    var labelDataPoints = [];
                    (data.dataLabelsSettings && data.dataLabelsSettings.show || data.dataLabelsSettings.showCategory) && (labelDataPoints = ScatterChartDataLabels.createLabelDataPoints(viewModel));
                    var behaviorOptions = this.renderer.render(viewModel, this.interactivityService);
                    this.isMobileChart && (behaviorOptions = {
                        data: behaviorOptions.data,
                        dataPointsSelection: behaviorOptions.dataPointsSelection,
                        eventGroup: behaviorOptions.eventGroup,
                        plotContext: behaviorOptions.plotContext,
                        host: this.cartesianVisualHost,
                        root: this.svg,
                        visualInitOptions: this.options,
                        xAxisProperties: this.xAxisProperties,
                        yAxisProperties: this.yAxisProperties,
                        background: d3.select(this.element.get(0))
                    });
                    var playRenderResult;
                    if (this.playAxis && (playRenderResult = this.playAxis.render(suppressAnimations, viewModel, viewport, margin), 
                    this.interactivityService)) {
                        var playBehaviorOptions = {
                            traceLineRenderer: this.renderer.createTraceLineRenderer(playRenderResult.viewModel)
                        };
                        hasSelection && visuals.PlayChart.renderTraceLines(playRenderResult.allDataPoints, playBehaviorOptions.traceLineRenderer, !suppressAnimations), 
                        behaviorOptions.playOptions = playBehaviorOptions;
                    }
                    return {
                        dataPoints: playRenderResult ? playRenderResult.allDataPoints : data.dataPoints,
                        behaviorOptions: behaviorOptions,
                        labelDataPoints: labelDataPoints,
                        labelsAreNumeric: !1,
                        animateLabels: !0
                    };
                }
            }, ScatterChart.getStrokeFill = function(d, colorBorder) {
                if (null != d.size && colorBorder) {
                    var colorRgb = Color.parseColorString(d.fill);
                    return Color.hexString(Color.darken(colorRgb, ScatterChart.StrokeDarkenColorValue));
                }
                return d.fill;
            }, ScatterChart.getMarkerFillOpacity = function(hasSize, shouldEnableFill, hasSelection, isSelected) {
                return hasSize || shouldEnableFill ? hasSelection && !isSelected ? ScatterChart.DimmedBubbleOpacity : ScatterChart.DefaultBubbleOpacity : 0;
            }, ScatterChart.getMarkerStrokeOpacity = function(hasSize, colorBorder, hasSelection, isSelected) {
                return hasSize && colorBorder ? 1 : hasSelection && !isSelected ? ScatterChart.DimmedBubbleOpacity : ScatterChart.DefaultBubbleOpacity;
            }, ScatterChart.getMarkerStrokeFill = function(hasSize, colorBorder, fill) {
                if (hasSize && colorBorder) {
                    var colorRgb = Color.parseColorString(fill);
                    return Color.hexString(Color.darken(colorRgb, ScatterChart.StrokeDarkenColorValue));
                }
                return fill;
            }, ScatterChart.getMarkerStyle = function(d, colorBorder, hasSelection, fillMarkers) {
                return {
                    "stroke-opacity": ScatterChart.getMarkerStrokeOpacity(null != d.size, colorBorder, hasSelection, d.selected),
                    stroke: ScatterChart.getMarkerStrokeFill(null != d.size, colorBorder, d.fill),
                    fill: d.fill,
                    "fill-opacity": ScatterChart.getMarkerFillOpacity(null != d.size, fillMarkers, hasSelection, d.selected)
                };
            }, ScatterChart.getSeriesStyle = function(hasSize, colorBorder, hasSelection, fillMarkers, fill) {
                return {
                    "stroke-opacity": ScatterChart.getMarkerStrokeOpacity(hasSize, colorBorder, hasSelection, !1),
                    stroke: ScatterChart.getMarkerStrokeFill(hasSize, colorBorder, fill),
                    fill: fill,
                    "fill-opacity": ScatterChart.getMarkerFillOpacity(hasSize, fillMarkers, hasSelection, !1)
                };
            }, ScatterChart.getBubbleOpacity = function(d, hasSelection) {
                return hasSelection && !d.selected ? ScatterChart.DimmedBubbleOpacity : ScatterChart.DefaultBubbleOpacity;
            }, ScatterChart.prototype.onClearSelection = function() {
                this.interactivityService && this.interactivityService.clearSelection();
            }, ScatterChart.prototype.getSupportedCategoryAxisType = function() {
                return visuals.axisType.scalar;
            }, ScatterChart.sortBubbles = function(a, b) {
                if (a.radius.sizeMeasure) {
                    var diff = b.radius.sizeMeasure.values[b.radius.index] - a.radius.sizeMeasure.values[a.radius.index];
                    if (0 !== diff) return diff;
                } else if (null != a.radius.value) return b.radius.value - a.radius.value;
                return b.identity.getKey().localeCompare(a.identity.getKey());
            }, ScatterChart.prototype.getCartesianVisualCapabilities = function() {
                return {
                    supportsHierarchicalCategoryAxis: !1
                };
            }, ScatterChart.prototype.getStaticSeriesRole = function() {}, ScatterChart.DefaultBubbleOpacity = .85, 
            ScatterChart.DimmedBubbleOpacity = .4, ScatterChart.StrokeDarkenColorValue = 63.75, 
            ScatterChart.ClassName = "scatterChart", ScatterChart.NoAnimationThreshold = 1e3, 
            ScatterChart.NoRenderResizeThreshold = 1e3, ScatterChart.DefaultDataVolume = 3500, 
            ScatterChart.MaximumDataVolume = 1e4, ScatterChart.DefaultPlotAreaShadingSettings = {
                show: !1,
                upperShadingColor: null,
                lowerShadingColor: null,
                transparency: 70
            }, ScatterChart;
        }();
        visuals.ScatterChart = ScatterChart;
        var ScatterChartDataLabels;
        !function(ScatterChartDataLabels) {
            function createLabelDataPoints(viewModel) {
                for (var xScale = viewModel.xAxisProperties.scale, yScale = viewModel.yAxisProperties.scale, sizeRange = viewModel.data.sizeRange, multiplier = viewModel.data.multiplier, labelDataPoints = [], dataPoints = viewModel.data.dataPoints, labelSettings = viewModel.data.dataLabelsSettings, preferredLabelsKeys = getPreferredLabelsKeys(viewModel), _i = 0, dataPoints_1 = dataPoints; _i < dataPoints_1.length; _i++) {
                    var dataPoint = dataPoints_1[_i], text = dataPoint.formattedCategory.getValue(), fontProperties = labelSettings ? labelSettings.fontProperties : visuals.LabelUtils.defaultFontProperties, properties = visuals.FontProperties.toTextProperties(fontProperties, text), textWidth = powerbi.TextMeasurementService.measureSvgTextWidth(properties), textHeight = powerbi.TextMeasurementService.estimateSvgTextHeight(properties);
                    labelDataPoints.push({
                        isPreferred: !!preferredLabelsKeys && isLabelPreferred(dataPoint.identity.getKey(), preferredLabelsKeys),
                        text: text,
                        textSize: {
                            width: textWidth,
                            height: textHeight
                        },
                        outsideFill: fontProperties.color ? fontProperties.color : visuals.LabelUtils.defaultLabelColor,
                        insideFill: visuals.LabelUtils.defaultInsideLabelColor,
                        parentType: 0,
                        parentShape: {
                            point: {
                                x: xScale(dataPoint.x),
                                y: yScale(dataPoint.y)
                            },
                            radius: visuals.CartesianHelper.getBubbleRadius(dataPoint.radius, sizeRange, viewModel.plotArea, multiplier),
                            validPositions: validLabelPositions
                        },
                        identity: dataPoint.identity,
                        fontProperties: fontProperties
                    });
                }
                return labelDataPoints;
            }
            function getPreferredLabelsKeys(viewModel) {
                var width = viewModel.plotArea.width, height = viewModel.plotArea.height, visualCenter = new visuals.Point(width / 2, height / 2), quadrantsCenters = getQuadrantsCenters(width, height);
                return getCandidateLabels(visualCenter, quadrantsCenters, viewModel);
            }
            function getQuadrantsCenters(visualWidth, visualHeight) {
                var quadrantsCenters = [], quarterWidth = visualWidth / 4, quarterHeight = visualHeight / 4;
                return quadrantsCenters.push(new visuals.Point(quarterWidth, quarterHeight)), quadrantsCenters.push(new visuals.Point(3 * quarterWidth, quarterHeight)), 
                quadrantsCenters.push(new visuals.Point(quarterWidth, 3 * quarterHeight)), quadrantsCenters.push(new visuals.Point(3 * quarterWidth, 3 * quarterHeight)), 
                quadrantsCenters;
            }
            function getCandidateLabels(visualCenter, quadrantsCenters, viewModel) {
                for (var distance, minDistances = [ Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE ], ids = [], xScale = viewModel.xAxisProperties.scale, yScale = viewModel.yAxisProperties.scale, _i = 0, _a = viewModel.data.dataPoints; _i < _a.length; _i++) {
                    var dp = _a[_i], x = xScale(dp.x), y = yScale(dp.y), quadrantNumber = getPointQuadrantNumber(x, y, visualCenter);
                    viewModel.drawBubbles ? ids[quadrantNumber] || (ids[quadrantNumber] = dp.identity) : (distance = getDistanceBetweenPoints(quadrantsCenters[quadrantNumber].x, quadrantsCenters[quadrantNumber].y, x, y), 
                    distance < minDistances[quadrantNumber] && (ids[quadrantNumber] = dp.identity, minDistances[quadrantNumber] = distance));
                }
                for (var preferredLabelsKeys = [], _b = 0, ids_1 = ids; _b < ids_1.length; _b++) {
                    var id = ids_1[_b];
                    id && preferredLabelsKeys.push(id.getKey());
                }
                return preferredLabelsKeys;
            }
            function getPointQuadrantNumber(x, y, centerPoint) {
                return x > centerPoint.x && y <= centerPoint.y ? 0 : x <= centerPoint.x && y <= centerPoint.y ? 1 : x <= centerPoint.x && y > centerPoint.y ? 2 : 3;
            }
            function getDistanceBetweenPoints(x1, y1, x2, y2) {
                return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
            }
            function isLabelPreferred(key, preferredLabelsKeys) {
                for (var _i = 0, preferredLabelsKeys_1 = preferredLabelsKeys; _i < preferredLabelsKeys_1.length; _i++) {
                    var preferredLabel = preferredLabelsKeys_1[_i];
                    if (0 === key.localeCompare(preferredLabel)) return !0;
                }
                return !1;
            }
            var validLabelPositions = [ 2, 1, 8, 4, 16, 32, 64, 128 ];
            ScatterChartDataLabels.createLabelDataPoints = createLabelDataPoints;
        }(ScatterChartDataLabels || (ScatterChartDataLabels = {}));
        var ScatterChartHitTester = function() {
            function ScatterChartHitTester(dataPoints) {
                this.dataPoints = dataPoints;
            }
            return ScatterChartHitTester.prototype.queryRegion = function(rect) {
                var selectedPoints = _.filter(this.dataPoints, function(point) {
                    return powerbi.Double.lessOrEqualWithPrecision(rect.left, point.x) && powerbi.Double.lessOrEqualWithPrecision(point.x, rect.right) && powerbi.Double.lessOrEqualWithPrecision(rect.bottom, point.y) && powerbi.Double.lessOrEqualWithPrecision(point.y, rect.top);
                });
                return selectedPoints;
            }, ScatterChartHitTester;
        }();
        visuals.ScatterChartHitTester = ScatterChartHitTester;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var createClassAndSelector = jsCommon.CssConstants.createClassAndSelector, PerfTimer = jsCommon.PerfTimer, ScatterChartWebBehavior = function() {
            function ScatterChartWebBehavior() {}
            return ScatterChartWebBehavior.prototype.bindEvents = function(options, selectionHandler) {
                var bubbles = this.bubbles = options.dataPointsSelection, data = options.data, eventGroup = options.eventGroup;
                !this.playOptions || !this.playOptions.traceLineRenderer || options.playOptions && options.playOptions.traceLineRenderer || this.playOptions.traceLineRenderer.remove(), 
                this.playOptions = options.playOptions, this.shouldEnableFill = !data.size && data.fillPoint, 
                this.colorBorder = data.colorBorder, this.hitTester = new visuals.ScatterChartHitTester(options.data.dataPoints), 
                this.selectionHandler = selectionHandler, eventGroup ? visuals.InteractivityUtils.registerGroupInteractivityHandlers(eventGroup, selectionHandler) : visuals.InteractivityUtils.registerStandardInteractivityHandlers(bubbles, selectionHandler);
            }, ScatterChartWebBehavior.prototype.renderSelection = function(hasSelection) {
                var shouldEnableFill = this.shouldEnableFill, colorBorder = this.colorBorder;
                if (this.bubbles.style({
                    "fill-opacity": function(d) {
                        return visuals.ScatterChart.getMarkerFillOpacity(null != d.size, shouldEnableFill, hasSelection, d.selected);
                    },
                    "stroke-opacity": function(d) {
                        return visuals.ScatterChart.getMarkerStrokeOpacity(null != d.size, colorBorder, hasSelection, d.selected);
                    }
                }), this.playOptions && this.bubbles) {
                    var selectedPoints = this.bubbles.filter(function(d) {
                        return d.selected;
                    }).data(), traceLineRenderer = this.playOptions.traceLineRenderer;
                    selectedPoints && selectedPoints.length > 0 && null != traceLineRenderer ? traceLineRenderer.render(selectedPoints, !0) : traceLineRenderer.remove();
                }
            }, ScatterChartWebBehavior.prototype.lassoSelect = function(e, rect) {
                var dataPoints = this.hitTester.queryRegion(rect), mode = 0;
                e.ctrlKey ? mode = 1 : e.altKey ? mode = 3 : e.shiftKey && (mode = 2), this.selectionHandler.handleMultipleSelection(dataPoints, mode);
            }, ScatterChartWebBehavior;
        }();
        visuals.ScatterChartWebBehavior = ScatterChartWebBehavior;
        var ScatterChartMobileBehavior = function() {
            function ScatterChartMobileBehavior() {}
            return ScatterChartMobileBehavior.prototype.bindEvents = function(options, selectionHandler) {
                this.setOptions(options), options.visualInitOptions && options.visualInitOptions.interactivity.isInteractiveLegend && (this.makeDataPointsSelectable(options.dataPointsSelection), 
                this.makeRootSelectable(options.root), this.makeDragable(options.root), this.disableDefaultTouchInteractions(options.root), 
                this.selectRoot());
            }, ScatterChartMobileBehavior.prototype.renderSelection = function(HasSelection) {}, 
            ScatterChartMobileBehavior.prototype.setSelectionHandler = function(selectionHandler) {}, 
            ScatterChartMobileBehavior.prototype.makeDataPointsSelectable = function() {
                for (var _this = this, selection = [], _i = 0; _i < arguments.length; _i++) selection[_i] = arguments[_i];
                for (var i = 0, len = selection.length; i < len; i++) {
                    var sel = selection[i];
                    sel.on("click", function(d, i) {
                        _this.select(i);
                    });
                }
            }, ScatterChartMobileBehavior.prototype.makeRootSelectable = function(selection) {
                var _this = this;
                selection.on("click", function(d, i) {
                    _this.selectRoot();
                });
            }, ScatterChartMobileBehavior.prototype.makeDragable = function() {
                for (var _this = this, selection = [], _i = 0; _i < arguments.length; _i++) selection[_i] = arguments[_i];
                for (var i = 0, len = selection.length; i < len; i++) {
                    var sel = selection[i], drag = d3.behavior.drag().on("drag", function(d) {
                        _this.drag(0);
                    }).on("dragend", function(d) {
                        _this.drag(1);
                    });
                    sel.call(drag);
                }
            }, ScatterChartMobileBehavior.prototype.disableDefaultTouchInteractions = function(selection) {
                selection.style("touch-action", "none");
            }, ScatterChartMobileBehavior.prototype.setOptions = function(options) {
                this.data = options.data, this.mainGraphicsContext = options.plotContext, this.xAxisProperties = options.xAxisProperties, 
                this.yAxisProperties = options.yAxisProperties, this.host = options.host;
            }, ScatterChartMobileBehavior.prototype.select = function(index) {
                this.selectDotByIndex(index);
            }, ScatterChartMobileBehavior.prototype.selectRoot = function() {
                var timer = PerfTimer.start("selectRoot");
                this.onClick(), timer();
            }, ScatterChartMobileBehavior.prototype.drag = function(t) {
                switch (t) {
                  case 0:
                    this.onDrag();
                    break;

                  case 1:
                    this.onClick();
                }
            }, ScatterChartMobileBehavior.prototype.onDrag = function() {
                var xy = this.getMouseCoordinates();
                this.moveCrosshairToXY(xy.x, xy.y);
                var selectedIndex = this.findClosestDotIndex(xy.x, xy.y);
                this.selectDot(selectedIndex), this.updateLegend(selectedIndex);
            }, ScatterChartMobileBehavior.prototype.onClick = function() {
                var xy = this.getMouseCoordinates(), selectedIndex = this.findClosestDotIndex(xy.x, xy.y);
                selectedIndex !== -1 && this.selectDotByIndex(selectedIndex);
            }, ScatterChartMobileBehavior.prototype.getMouseCoordinates = function() {
                var mainGfxContext = this.mainGraphicsContext, x = 0, y = parseInt(mainGfxContext.attr("height"), 10);
                y = y || 0;
                try {
                    var mouse = d3.mouse(mainGfxContext.node());
                    x = mouse[0], y = mouse[1];
                } catch (e) {}
                return {
                    x: x,
                    y: y
                };
            }, ScatterChartMobileBehavior.prototype.selectDotByIndex = function(index) {
                this.selectDot(index), this.moveCrosshairToIndexDot(index), this.updateLegend(index);
            }, ScatterChartMobileBehavior.prototype.selectDot = function(dotIndex) {
                var _this = this, root = this.mainGraphicsContext;
                root.selectAll(ScatterChartMobileBehavior.ScatterMarker.selector).classed({
                    selected: !1,
                    notSelected: !0
                }), root.selectAll(ScatterChartMobileBehavior.ScatterMarker.selector).filter(function(d, i) {
                    var dataPoints = _this.data.dataPoints, currentPoint = dataPoints[dotIndex];
                    return d.x === currentPoint.x && d.y === currentPoint.y;
                }).classed({
                    selected: !0,
                    notSelected: !1
                });
            }, ScatterChartMobileBehavior.prototype.moveCrosshairToIndexDot = function(index) {
                var dataPoints = this.data.dataPoints, root = this.mainGraphicsContext, x = this.xAxisProperties.scale(dataPoints[index].x), y = this.yAxisProperties.scale(dataPoints[index].y);
                if (null == this.crosshair) {
                    var width = +root.attr("width"), height = +root.attr("height");
                    this.crosshair = this.drawCrosshair(root, x, y, width, height), this.crosshairHorizontal = this.crosshair.select(ScatterChartMobileBehavior.Horizontal.selector), 
                    this.crosshairVertical = this.crosshair.select(ScatterChartMobileBehavior.Vertical.selector);
                } else this.moveCrosshairToXY(x, y);
            }, ScatterChartMobileBehavior.prototype.moveCrosshairToXY = function(x, y) {
                this.crosshairHorizontal.attr({
                    y1: y,
                    y2: y
                }), this.crosshairVertical.attr({
                    x1: x,
                    x2: x
                });
            }, ScatterChartMobileBehavior.prototype.drawCrosshair = function(addTo, x, y, width, height) {
                var crosshair = addTo.append("g");
                return crosshair.classed(ScatterChartMobileBehavior.CrosshairClassName, !0), crosshair.append("line").classed(ScatterChartMobileBehavior.Horizontal.class, !0).attr({
                    x1: 0,
                    x2: width,
                    y1: y,
                    y2: y
                }), crosshair.append("line").classed(ScatterChartMobileBehavior.Vertical.class, !0).attr({
                    x1: x,
                    x2: x,
                    y1: height,
                    y2: 0
                }), crosshair;
            }, ScatterChartMobileBehavior.prototype.findClosestDotIndex = function(x, y) {
                var selectedIndex = -1, minDistance = Number.MAX_VALUE, dataPoints = this.data.dataPoints, xAxisPropertiesScale = this.xAxisProperties.scale, yAxisPropertiesScale = this.yAxisProperties.scale;
                for (var i in dataPoints) {
                    var currentPoint = dataPoints[i], circleX = xAxisPropertiesScale(currentPoint.x), circleY = yAxisPropertiesScale(currentPoint.y), horizontalDistance = circleX - x, verticalDistance = circleY - y, distanceSqrd = horizontalDistance * horizontalDistance + verticalDistance * verticalDistance;
                    minDistance === Number.MAX_VALUE ? (selectedIndex = i, minDistance = distanceSqrd) : minDistance && minDistance > distanceSqrd && (selectedIndex = i, 
                    minDistance = distanceSqrd);
                }
                return selectedIndex;
            }, ScatterChartMobileBehavior.prototype.updateLegend = function(dotIndex) {
                if (null == this.lastDotIndex || this.lastDotIndex !== dotIndex) {
                    var legendItems = this.createLegendDataPoints(dotIndex);
                    this.host.updateLegend(legendItems), this.lastDotIndex = dotIndex;
                }
            }, ScatterChartMobileBehavior.prototype.createLegendDataPoints = function(dotIndex) {
                var formatStringProp = visuals.scatterChartProps.general.formatString, legendItems = [], data = this.data, point = data.dataPoints[dotIndex], blank = visuals.valueFormatter.format(null), title = blank, legendData = data.legendData, legendDataPoints = legendData.dataPoints, category = point.formattedCategory.getValue();
                category !== blank ? (title = category, null != point && null != point.radius && null != point.radius.sizeMeasure && (title += "; " + visuals.valueFormatter.format(point.radius.sizeMeasure.source.groupName))) : null != point.radius.sizeMeasure ? title = visuals.valueFormatter.format(point.radius.sizeMeasure.source.groupName) : legendDataPoints.length > 0 && legendDataPoints.length >= dotIndex && legendDataPoints[dotIndex].label !== blank && (title = legendDataPoints[dotIndex].label), 
                null != data.xCol && legendItems.push({
                    category: title,
                    color: point.fill,
                    identity: visuals.SelectionIdBuilder.builder().withMeasure(data.xCol.queryName).createSelectionId(),
                    selected: point.selected,
                    icon: visuals.LegendIcon.Box,
                    label: visuals.valueFormatter.format(this.data.axesLabels.x),
                    measure: visuals.valueFormatter.format(point.x, visuals.valueFormatter.getFormatString(data.xCol, formatStringProp)),
                    iconOnlyOnLabel: !0
                }), null != data.yCol && legendItems.push({
                    category: title,
                    color: point.fill,
                    identity: visuals.SelectionIdBuilder.builder().withMeasure(data.yCol.queryName).createSelectionId(),
                    selected: point.selected,
                    icon: visuals.LegendIcon.Box,
                    label: visuals.valueFormatter.format(data.axesLabels.y),
                    measure: visuals.valueFormatter.format(point.y, visuals.valueFormatter.getFormatString(data.yCol, formatStringProp)),
                    iconOnlyOnLabel: !0
                }), null != data.size && legendItems.push({
                    category: title,
                    color: point.fill,
                    identity: visuals.SelectionIdBuilder.builder().withMeasure(data.size.queryName).createSelectionId(),
                    selected: point.selected,
                    icon: visuals.LegendIcon.Box,
                    label: visuals.valueFormatter.format(data.size.displayName),
                    measure: visuals.valueFormatter.format(point.radius.sizeMeasure && point.radius.sizeMeasure.values[point.radius.index] || point.radius.value, visuals.valueFormatter.getFormatString(data.size, formatStringProp)),
                    iconOnlyOnLabel: !0
                });
                var newLegendData = visuals.Legend.getDefaultLegendData();
                return newLegendData.dataPoints = legendItems, newLegendData;
            }, ScatterChartMobileBehavior.CrosshairClassName = "crosshair", ScatterChartMobileBehavior.ScatterMarker = createClassAndSelector("scatterMarker"), 
            ScatterChartMobileBehavior.Horizontal = createClassAndSelector("horizontal"), ScatterChartMobileBehavior.Vertical = createClassAndSelector("vertical"), 
            ScatterChartMobileBehavior;
        }();
        visuals.ScatterChartMobileBehavior = ScatterChartMobileBehavior;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var createClassAndSelector = jsCommon.CssConstants.createClassAndSelector, LabelPosition = visuals.labelPosition, Lazy = jsCommon.Lazy, StringExtensions = jsCommon.StringExtensions, WaterfallChart = function() {
            function WaterfallChart(options) {
                this.isScrollable = options.isScrollable, this.tooltipsEnabled = null == options.tooltipsEnabled || options.tooltipsEnabled, 
                this.interactivityService = options.interactivityService, this.axisControlImprovements = options.featureSwitches.axisControlImprovements, 
                this.customFontFamilyForDataLabel = options.featureSwitches.customFontFamilyForDataLabel, 
                this.waterfallBreakdown = options.featureSwitches.waterfallBreakdown;
            }
            return WaterfallChart.prototype.init = function(options) {
                this.svg = options.svg, this.svg.classed(WaterfallChart.WaterfallClassName, !0), 
                this.style = options.style, this.currentViewport = options.viewport, this.hostServices = options.host, 
                this.interactivity = options.interactivity, this.cartesianVisualHost = options.cartesianHost, 
                this.options = options, this.element = options.element, this.tooltipService = options.services.tooltips, 
                this.colors = this.style.colorPalette.dataColors, this.mainGraphicsSVG = this.svg.append("svg"), 
                this.mainGraphicsContext = this.mainGraphicsSVG.append("g").classed(WaterfallChart.MainGraphicsContextClassName, !0), 
                this.labelGraphicsContext = this.mainGraphicsSVG.append("g").classed(visuals.LabelUtils.labelGraphicsContextClass.class, !0);
            }, WaterfallChart.converter = function(options) {
                var dataView = options.dataView;
                if (dataView) return dataView.categorical ? WaterfallChart.categoricalConverter(options) : dataView.matrix ? powerbi.requireSync("PowerBIVisuals/visuals/converter/waterfall.converter").matrixConverter(options) : void 0;
            }, WaterfallChart.categoricalConverter = function(options) {
                var categoryMetadata, tooltipMetadataColumns, dataView = options.dataView, hostServices = options.hostServices, dataLabelSettings = options.dataLabelSettings, sentimentColors = options.sentimentColors, interactivityService = options.interactivityService, tooltipsEnabled = options.tooltipsEnabled, reader = powerbi.data.createDataViewCategoricalReaderAdvanced(dataView), dataReader = reader.data, formatStringProp = WaterfallChart.formatStringProp, categories = dataView.categorical.categories || [], totalLabel = hostServices.getLocalizedString(WaterfallChart.TotalLabel), legendData = WaterfallChart.createLegend(sentimentColors, hostServices, reader.objects.getStaticObjects()), pos = {
                    current: 0,
                    min: 0,
                    max: 0
                }, dataPoints = [], categoryValues = [], valuesMetadata = [];
                if (dataReader.hasValues("Tooltips") && (tooltipMetadataColumns = reader.columns.getAllValueMetadataColumnsForRole("Tooltips", void 0)), 
                dataReader.hasValues("Y")) {
                    valuesMetadata = [ reader.columns.getValueMetadataColumn("Y") ];
                    var labelFormatString = valuesMetadata[0].format;
                    if (_.isEmpty(categories)) {
                        var value = dataReader.getValue("Y", 0);
                        pos = {
                            current: value,
                            max: value,
                            min: 0
                        };
                    } else {
                        var categoryColumn = categories[0];
                        categoryMetadata = categoryColumn.source, categoryValues = categoryColumn.values.slice(), 
                        categoryValues.push(totalLabel);
                        for (var categoryIndex = 0, catLen = dataReader.getCategoryCount(); categoryIndex < catLen; categoryIndex++) {
                            var category = categoryValues[categoryIndex], value = dataReader.getValue("Y", categoryIndex) || 0, identity = visuals.SelectionIdBuilder.builder().withCategory(categoryColumn, categoryIndex).withMeasure(valuesMetadata[0].queryName).createSelectionId(), tooltipBuilder = void 0;
                            if (tooltipsEnabled) {
                                tooltipBuilder = WaterfallChart.createCategoryTooltip(categoryMetadata ? [ categoryMetadata ] : null, valuesMetadata[0], [ category ], value, formatStringProp);
                                var tooltipValues = dataReader.getAllValuesForRole("Tooltips", categoryIndex);
                                tooltipValues && tooltipMetadataColumns && WaterfallChart.appendTooltipMeasures(tooltipValues, tooltipBuilder, tooltipMetadataColumns, formatStringProp, hostServices);
                            }
                            dataPoints.push(WaterfallChart.createDataPoint(value, pos.current, sentimentColors, category, categoryIndex, identity, tooltipBuilder, dataLabelSettings.fontProperties.color, labelFormatString, 0)), 
                            pos = WaterfallChart.getNewPositionContext(pos, value);
                        }
                    }
                    var totalTooltipBuilder = void 0;
                    tooltipsEnabled && (totalTooltipBuilder = WaterfallChart.createCategoryTooltip(categoryMetadata ? [ categoryMetadata ] : null, valuesMetadata[0], [ totalLabel ], pos.current, formatStringProp));
                    var totalIdentity = visuals.SelectionId.createNull();
                    dataPoints.push(WaterfallChart.createDataPoint(pos.current, 0, sentimentColors, totalLabel, categoryIndex, totalIdentity, totalTooltipBuilder, dataLabelSettings.fontProperties.color, labelFormatString, 1, {
                        text: !0
                    }));
                }
                interactivityService && interactivityService.applySelectionStateToData(dataPoints);
                var xAxisProperties = visuals.CartesianHelper.getCategoryAxisProperties(dataView.metadata, void 0), preferredCategoryWidth = visuals.CartesianHelper.getPreferredCategoryWidth(xAxisProperties);
                return {
                    series: [ {
                        data: dataPoints,
                        type: !_.isEmpty(valuesMetadata) && valuesMetadata[0].type
                    } ],
                    categories: categoryValues,
                    categoryMetadata: categoryMetadata,
                    preferredCategoryWidth: preferredCategoryWidth,
                    valuesMetadata: valuesMetadata,
                    legend: legendData,
                    hasHighlights: !1,
                    positionMin: pos.min,
                    positionMax: pos.max,
                    dataLabelsSettings: dataLabelSettings,
                    sentimentColors: sentimentColors
                };
            }, WaterfallChart.createDataPoint = function(value, position, colors, categoryValue, categoryIndex, identity, tooltipBuilder, labelFill, labelFormatString, barType, type) {
                var fill;
                return fill = 1 === barType || 2 === barType ? colors.totalFill : 3 === barType ? colors.otherFill : value > 0 ? colors.increaseFill : colors.decreaseFill, 
                {
                    value: value,
                    position: position,
                    color: fill.solid.color,
                    categoryValue: categoryValue,
                    categoryIndex: categoryIndex,
                    identity: identity,
                    seriesIndex: 0,
                    selected: !1,
                    highlight: !1,
                    key: identity.getKey(),
                    tooltipInfo: tooltipBuilder && function() {
                        return tooltipBuilder.getTooltipItems();
                    },
                    labelFill: labelFill,
                    labelFormatString: labelFormatString,
                    type: powerbi.ValueType.fromDescriptor(type),
                    barType: barType
                };
            }, WaterfallChart.createCategoryTooltip = function(categoryMetadata, valueMetadata, category, value, formatStringProp) {
                var tooltipBuilder = new visuals.LazyTooltipBuilder();
                return _.isEmpty(categoryMetadata) || tooltipBuilder.withLazyValue(new Lazy(function() {
                    return {
                        displayName: _.map(categoryMetadata, function(c) {
                            return c.displayName;
                        }).join(" "),
                        value: _.map(category, function(c, i) {
                            return visuals.converterHelper.formatFromMetadataColumn(c, categoryMetadata[i], formatStringProp);
                        }).join(" ")
                    };
                })), null != value && valueMetadata && tooltipBuilder.withLazyValue(new Lazy(function() {
                    return {
                        displayName: valueMetadata.displayName,
                        value: visuals.converterHelper.formatFromMetadataColumn(value, valueMetadata, formatStringProp, !1)
                    };
                })), tooltipBuilder;
            }, WaterfallChart.appendTooltipMeasures = function(tooltipValues, tooltipBuilder, tooltipMetadataColumns, formatStringProp, hostServices, previousValues, categoryValue, previousCategoryValue) {
                if (!_.isEmpty(tooltipValues) && !_.isEmpty(tooltipMetadataColumns)) for (var _loop_4 = function(j) {
                    if (null != tooltipValues[j] && tooltipMetadataColumns[j]) {
                        var displayName_1 = tooltipMetadataColumns[j].displayName, formattedValue_1 = visuals.converterHelper.formatFromMetadataColumn(tooltipValues[j], tooltipMetadataColumns[j], formatStringProp, !1);
                        if (_.isEmpty(previousValues)) tooltipBuilder.withLazyValue(new Lazy(function() {
                            return {
                                displayName: displayName_1,
                                value: formattedValue_1
                            };
                        })); else {
                            var currentValue = tooltipValues[j], previousValue = previousValues[j];
                            if (_.isNumber(currentValue) && _.isNumber(previousValue)) displayName_1 = StringExtensions.format(hostServices.getLocalizedString("Waterfall_BreakdownDifferenceTooltip"), displayName_1), 
                            formattedValue_1 = WaterfallChart.createPercentTooltipValue(formattedValue_1, currentValue, previousValue), 
                            tooltipBuilder.withLazyValue(new Lazy(function() {
                                return {
                                    displayName: displayName_1,
                                    value: formattedValue_1
                                };
                            })); else {
                                if (null != previousValue) {
                                    var formattedPreviousValue_1 = visuals.converterHelper.formatFromMetadataColumn(previousValue, tooltipMetadataColumns[j], formatStringProp, !1);
                                    tooltipBuilder.withLazyValue(new Lazy(function() {
                                        return {
                                            displayName: previousCategoryValue + " " + displayName_1,
                                            value: formattedPreviousValue_1
                                        };
                                    }));
                                }
                                null != currentValue && tooltipBuilder.withLazyValue(new Lazy(function() {
                                    return {
                                        displayName: categoryValue + " " + displayName_1,
                                        value: formattedValue_1
                                    };
                                }));
                            }
                        }
                    }
                }, j = 0; j < tooltipValues.length; j++) _loop_4(j);
            }, WaterfallChart.createPercentTooltipValue = function(formattedDifferenceValue, difference, previousValue) {
                if (!previousValue) return formattedDifferenceValue;
                var percentValue = difference / Math.abs(previousValue), formatString = visuals.valueFormatter.getLocalizedString("Percentage"), formattedPercentChange = visuals.valueFormatter.format(percentValue, formatString);
                return formattedDifferenceValue + " (" + formattedPercentChange + ")";
            }, WaterfallChart.createLegend = function(sentimentColors, hostServices, objects, includeOther) {
                var increaseColor = sentimentColors.increaseFill.solid.color, decreaseColor = sentimentColors.decreaseFill.solid.color, totalColor = sentimentColors.totalFill.solid.color, otherColor = sentimentColors.otherFill.solid.color, totalLabel = hostServices.getLocalizedString(WaterfallChart.TotalLabel), increaseLabel = hostServices.getLocalizedString(WaterfallChart.IncreaseLabel), decreaseLabel = hostServices.getLocalizedString(WaterfallChart.DecreaseLabel), otherLabel = hostServices.getLocalizedString(WaterfallChart.OtherLabel), legendDataPoints = [ {
                    label: increaseLabel,
                    color: increaseColor,
                    icon: visuals.LegendIcon.Box,
                    identity: visuals.SelectionIdBuilder.builder().withMeasure("increase").createSelectionId(),
                    selected: !1
                }, {
                    label: decreaseLabel,
                    color: decreaseColor,
                    icon: visuals.LegendIcon.Box,
                    identity: visuals.SelectionIdBuilder.builder().withMeasure("decrease").createSelectionId(),
                    selected: !1
                }, {
                    label: totalLabel,
                    color: totalColor,
                    icon: visuals.LegendIcon.Box,
                    identity: visuals.SelectionIdBuilder.builder().withMeasure("total").createSelectionId(),
                    selected: !1
                } ];
                return includeOther && legendDataPoints.splice(2, 0, {
                    label: otherLabel,
                    color: otherColor,
                    icon: visuals.LegendIcon.Box,
                    identity: visuals.SelectionIdBuilder.builder().withMeasure("other").createSelectionId(),
                    selected: !1
                }), visuals.LegendData.create(objects, legendDataPoints, !0, "", !1);
            }, WaterfallChart.getNewPositionContext = function(context, position) {
                var newPosition = context.current + position;
                return {
                    current: newPosition,
                    min: Math.min(context.min, newPosition),
                    max: Math.max(context.max, newPosition)
                };
            }, WaterfallChart.getDefaultWaterfallLabelSettings = function(show, labelColor, fontSizePt) {
                return void 0 === show && (show = !1), {
                    show: show,
                    labelOrientation: 1,
                    position: visuals.labelPosition.auto,
                    displayUnits: 0,
                    precision: visuals.dataLabelUtils.defaultLabelPrecision,
                    fontProperties: visuals.FontProperties.inherit(visuals.LabelUtils.defaultFontProperties, {
                        size: fontSizePt ? visuals.Units.FontSize.createFromPt(fontSizePt) : void 0,
                        color: labelColor || visuals.LabelUtils.defaultLabelColor
                    })
                };
            }, WaterfallChart.doesDataLabelFitInShape = function(d, yAxisProperties, layout) {
                if (null == d || null === d.value) return !1;
                var properties = {
                    text: layout.labelText(d),
                    fontFamily: visuals.dataLabelUtils.LabelTextProperties.fontFamily,
                    fontSize: visuals.dataLabelUtils.LabelTextProperties.fontSize,
                    fontWeight: visuals.dataLabelUtils.LabelTextProperties.fontWeight
                }, outsidePosition = visuals.CartesianHelper.getRectTop(yAxisProperties.scale, d.position, d.value) - visuals.dataLabelUtils.labelMargin;
                if (outsidePosition > 0) return !0;
                var textWidth = powerbi.TextMeasurementService.measureSvgTextWidth(properties), textHeight = powerbi.TextMeasurementService.estimateSvgTextHeight(properties), shapeWidth = layout.categoryWidth, shapeHeight = Math.abs(visuals.AxisHelper.diffScaled(yAxisProperties.scale, Math.max(0, Math.abs(d.value)), 0));
                return !(textWidth > shapeWidth || textHeight > shapeHeight);
            }, WaterfallChart.prototype.setData = function(dataViews) {
                var sentimentColors = this.getSentimentColorsFromObjects(null), numberOfBreakdowns = WaterfallChart.DefaultBreakdowns, dataView = dataViews.length > 0 ? dataViews[0] : void 0;
                if (this.data = {
                    series: [ {
                        data: []
                    } ],
                    categories: [],
                    valuesMetadata: [],
                    legend: visuals.Legend.getDefaultLegendData(),
                    hasHighlights: !1,
                    categoryMetadata: null,
                    scalarCategoryAxis: !1,
                    positionMax: 0,
                    positionMin: 0,
                    dataLabelsSettings: WaterfallChart.getDefaultWaterfallLabelSettings(!1, void 0),
                    sentimentColors: sentimentColors,
                    axesLabels: {
                        x: null,
                        y: null
                    },
                    numberOfBreakdowns: numberOfBreakdowns,
                    totalBreakdownCategories: 0
                }, dataView) {
                    if (dataView.metadata && dataView.metadata.objects) {
                        var objects = dataView.metadata.objects, labelsObj = objects.labels;
                        labelsObj && visuals.LabelUtils.updateLabelSettingsFromLabelsObject(labelsObj, this.data.dataLabelsSettings, !0), 
                        sentimentColors = this.getSentimentColorsFromObjects(objects), numberOfBreakdowns = powerbi.DataViewObjects.getValue(objects, visuals.waterfallChartProps.breakdown.maxBreakdowns, WaterfallChart.DefaultBreakdowns);
                    }
                    (dataView.categorical || dataView.matrix) && (this.data = WaterfallChart.converter({
                        dataView: dataView,
                        palette: this.colors,
                        hostServices: this.hostServices,
                        dataLabelSettings: this.data.dataLabelsSettings,
                        sentimentColors: sentimentColors,
                        interactivityService: this.interactivityService,
                        tooltipsEnabled: this.tooltipsEnabled,
                        axisControlImprovements: this.axisControlImprovements,
                        numberOfBreakdowns: numberOfBreakdowns
                    }));
                }
            }, WaterfallChart.prototype.enumerateObjectInstances = function(enumeration, options) {
                switch (options.objectName) {
                  case "sentimentColors":
                    this.enumerateSentimentColors(enumeration);
                    break;

                  case "labels":
                    var labelSettingOptions = {
                        enumeration: enumeration,
                        dataLabelsSettings: this.data.dataLabelsSettings,
                        positionObject: WaterfallChart.validLabelPositionsOptions,
                        show: !0,
                        displayUnits: !0,
                        precision: !0,
                        fontSize: !0,
                        fontFamily: this.customFontFamilyForDataLabel,
                        labelOrientation: !0,
                        position: !0
                    };
                    visuals.LabelUtils.enumerateDataLabels(labelSettingOptions);
                    break;

                  case visuals.waterfallChartProps.breakdown.maxBreakdowns.objectName:
                    this.enumerateBreakdown(enumeration);
                }
            }, WaterfallChart.prototype.enumerateSentimentColors = function(enumeration) {
                var sentimentColors = this.data.sentimentColors, properties = {
                    increaseFill: sentimentColors.increaseFill,
                    decreaseFill: sentimentColors.decreaseFill
                };
                this.data.isBreakdown && (properties.otherFill = sentimentColors.otherFill), properties.totalFill = sentimentColors.totalFill, 
                enumeration.pushInstance({
                    selector: null,
                    properties: properties,
                    objectName: "sentimentColors"
                });
            }, WaterfallChart.prototype.enumerateBreakdown = function(enumeration) {
                this.data.isBreakdown && enumeration.pushInstance({
                    selector: null,
                    properties: {
                        maxBreakdowns: this.data.numberOfBreakdowns
                    },
                    validValues: {
                        maxBreakdowns: {
                            numberRange: {
                                min: WaterfallChart.MinimumBreakdowns,
                                max: Math.min(WaterfallChart.MaximumBreakdowns, this.data.totalBreakdownCategories)
                            }
                        }
                    },
                    objectName: visuals.waterfallChartProps.breakdown.maxBreakdowns.objectName
                });
            }, WaterfallChart.prototype.calculateCustomLegend = function() {
                return this.data.legend;
            }, WaterfallChart.prototype.hasLegend = function() {
                return !0;
            }, WaterfallChart.createClippedDataIfOverflowed = function(data, renderableDataCount) {
                var clipped = data, dataPoints = data.series[0].data;
                return data && renderableDataCount < dataPoints.length && (clipped = powerbi.Prototype.inherit(data), 
                clipped.series = [ {
                    data: dataPoints.slice(0, renderableDataCount)
                } ], clipped.categories = data.categories.slice(0, renderableDataCount)), clipped;
            }, WaterfallChart.prototype.calculateAxesProperties = function(options) {
                var _this = this;
                this.currentViewport = options.viewport, this.margin = options.margin;
                var data = this.clippedData = this.data, series = data.series, categoryCount = data.categories.length, preferredPlotArea = this.getPreferredPlotArea(!1, categoryCount, visuals.CartesianHelper.MinOrdinalRectThickness, options.outerPaddingRatio), preferredCategoryWidth = data ? data.preferredCategoryWidth : null, cartesianLayout = visuals.CartesianChart.getLayout(null, {
                    availableWidth: preferredPlotArea.width,
                    categoryCount: categoryCount,
                    preferredCategoryWidth: preferredCategoryWidth,
                    domain: null,
                    isScalar: !1,
                    isScrollable: this.isScrollable,
                    trimOrdinalDataOnOverflow: options.trimOrdinalDataOnOverflow,
                    outerPaddingRatio: options.outerPaddingRatio
                });
                this.isScrollable || (data = this.clippedData = WaterfallChart.createClippedDataIfOverflowed(data, cartesianLayout.categoryCount));
                var xAxisCreationOptions = WaterfallChart.getXAxisCreationOptions(data, preferredPlotArea.width, cartesianLayout, options), yAxisCreationOptions = WaterfallChart.getYAxisCreationOptions(data, preferredPlotArea.height, options), xAxisProperties = this.xAxisProperties = visuals.AxisHelper.createAxis(xAxisCreationOptions), yAxisProperties = this.yAxisProperties = visuals.AxisHelper.createAxis(yAxisCreationOptions);
                this.xAxisProperties.outerPaddingRatio = cartesianLayout.outerPaddingRatio;
                var categoryWidth = this.xAxisProperties.categoryThickness * (1 - options.innerPaddingRatio), formattersCache = visuals.LabelUtils.createColumnFormatterCacheManager(), labelSettings = data.dataLabelsSettings, labelUnitsAndPrecision = visuals.LabelUtils.getLabelUnitAndPrecisionForAxis(yAxisProperties, labelSettings);
                return this.layout = {
                    categoryCount: cartesianLayout.categoryCount,
                    categoryThickness: cartesianLayout.categoryThickness,
                    isScalar: cartesianLayout.isScalar,
                    outerPaddingRatio: cartesianLayout.outerPaddingRatio,
                    categoryWidth: categoryWidth,
                    labelText: function(d) {
                        var type = series[d.seriesIndex].type, formatter = formattersCache.getOrCreate(d.labelFormatString, labelSettings, labelUnitsAndPrecision.units, labelUnitsAndPrecision.getPrecision(!!d.labelFormatString, type));
                        return visuals.LabelUtils.getLabelTailoredText({
                            label: formatter.format(d.value)
                        });
                    },
                    labelLayout: visuals.CartesianHelper.getLabelLayoutXYForWaterfall(xAxisProperties, categoryWidth, yAxisProperties, yAxisCreationOptions.dataDomain),
                    filter: function(d) {
                        return WaterfallChart.doesDataLabelFitInShape(d, yAxisProperties, _this.layout);
                    },
                    style: {
                        fill: function(d) {
                            return d.isLabelInside ? visuals.LabelUtils.defaultInsideLabelColor : d.labelFill;
                        }
                    }
                }, [ xAxisProperties, yAxisProperties ];
            }, WaterfallChart.lookupXValue = function(data, index, type) {
                var dataPoints = data.series[0].data;
                return index === dataPoints.length - 1 ? dataPoints[index].categoryValue : visuals.CartesianHelper.lookupXValue(data, index, dataPoints[index].type || type, !1);
            }, WaterfallChart.getXAxisCreationOptions = function(data, width, layout, options) {
                var categoryDataType = visuals.AxisHelper.getCategoryValueType(data.categoryMetadata), domain = visuals.AxisHelper.createDomain(data.series, categoryDataType, !1, options.forcedXDomain, options.ensureXDomain), categoryThickness = layout.categoryThickness, outerPadding = categoryThickness * layout.outerPaddingRatio;
                return {
                    pixelSpan: width,
                    dataDomain: domain,
                    metaDataColumn: data.categoryMetadata,
                    formatString: visuals.valueFormatter.getFormatString(data.categoryMetadata, WaterfallChart.formatStringProp),
                    isScalar: !1,
                    outerPadding: outerPadding,
                    categoryThickness: categoryThickness,
                    getValueFn: function(index, type) {
                        return WaterfallChart.lookupXValue(data, index, type);
                    },
                    forcedTickCount: options.forcedTickCount,
                    isCategoryAxis: !0,
                    axisDisplayUnits: options.categoryAxisDisplayUnits,
                    axisPrecision: options.categoryAxisPrecision,
                    outerPaddingRatio: layout.outerPaddingRatio,
                    preventNice: options.preventNiceX
                };
            }, WaterfallChart.getYAxisCreationOptions = function(data, height, options) {
                var combinedDomain = visuals.AxisHelper.combineDomain(options.forcedYDomain, [ data.positionMin, data.positionMax ], options.ensureYDomain);
                return {
                    pixelSpan: height,
                    dataDomain: combinedDomain,
                    zeroScalarDomain: [ 0, 1 ],
                    isScalar: !0,
                    isVertical: !0,
                    metaDataColumn: data.valuesMetadata,
                    formatString: visuals.valueFormatter.getFormatString(data.valuesMetadata[0], WaterfallChart.formatStringProp),
                    outerPadding: 0,
                    forcedTickCount: options.forcedTickCount,
                    useTickIntervalForDisplayUnits: !0,
                    isCategoryAxis: !1,
                    axisDisplayUnits: options.valueAxisDisplayUnits,
                    axisPrecision: options.valueAxisPrecision,
                    outerPaddingRatio: 0,
                    preventNice: options.preventNiceY
                };
            }, WaterfallChart.prototype.getPreferredPlotArea = function(isScalar, categoryCount, categoryThickness, outerPaddingRatio) {
                return visuals.CartesianChart.getPreferredPlotArea(categoryCount, categoryThickness, this.currentViewport, this.isScrollable, isScalar, this.margin, outerPaddingRatio);
            }, WaterfallChart.prototype.getVisualCategoryAxisIsScalar = function() {
                return !1;
            }, WaterfallChart.prototype.overrideXScale = function(xProperties) {
                this.xAxisProperties = xProperties;
            }, WaterfallChart.prototype.setFilteredData = function(startIndex, endIndex) {
                var data = this.clippedData = powerbi.Prototype.inherit(this.data);
                return data.series = [ {
                    data: data.series[0].data.slice(startIndex, endIndex)
                } ], data.categories = data.categories.slice(startIndex, endIndex), data;
            }, WaterfallChart.prototype.createRects = function(data) {
                var mainGraphicsContext = this.mainGraphicsContext, colsSelection = mainGraphicsContext.selectAll(WaterfallChart.CategoryValueClasses.selector), cols = colsSelection.data(data, function(d) {
                    return d.key;
                });
                return cols.enter().append("rect").attr("class", function(d) {
                    return WaterfallChart.CategoryValueClasses.class.concat(d.highlight ? "highlight" : "");
                }), cols.exit().remove(), cols;
            }, WaterfallChart.prototype.createConnectors = function(data) {
                var mainGraphicsContext = this.mainGraphicsContext, connectorSelection = mainGraphicsContext.selectAll(WaterfallChart.WaterfallConnectorClasses.selector), connectors = connectorSelection.data(data.slice(0, data.length - 1), function(d) {
                    return d.key;
                });
                return connectors.enter().append("line").classed(WaterfallChart.WaterfallConnectorClasses.class, !0), 
                connectors.exit().remove(), connectors;
            }, WaterfallChart.prototype.render = function(suppressAnimations) {
                var _this = this, dataPoints = this.clippedData.series[0].data, bars = this.createRects(dataPoints), connectors = this.createConnectors(dataPoints);
                this.tooltipsEnabled && this.tooltipService.addTooltip(bars, function(args) {
                    return args.data && args.data.tooltipInfo();
                }, function(args) {
                    return args.data && args.data.identity;
                });
                var hasSelection = this.interactivityService && this.interactivityService.hasSelection(), xScale = this.xAxisProperties.scale, yScale = this.yAxisProperties.scale, y0 = yScale(0);
                this.mainGraphicsSVG.attr("height", this.getAvailableHeight()).attr("width", this.getAvailableWidth()), 
                bars.style("fill", function(d) {
                    return d.color;
                }).style("fill-opacity", function(d) {
                    return 1 === d.barType ? visuals.ColumnUtil.DefaultOpacity : visuals.ColumnUtil.getFillOpacity(d.selected, d.highlight, hasSelection, _this.data.hasHighlights);
                }).attr("width", this.layout.categoryWidth).attr("x", function(d) {
                    return xScale(d.categoryIndex);
                }).attr("y", function(d) {
                    return visuals.CartesianHelper.getRectTop(yScale, d.position, d.value);
                }).attr("height", function(d) {
                    return y0 - yScale(Math.abs(d.value));
                }), connectors.attr({
                    x1: function(d) {
                        return xScale(d.categoryIndex);
                    },
                    y1: function(d) {
                        return yScale(d.position + d.value);
                    },
                    x2: function(d) {
                        return xScale(d.categoryIndex + 1) + _this.layout.categoryWidth;
                    },
                    y2: function(d) {
                        return yScale(d.position + d.value);
                    }
                });
                var labelSettings = this.data.dataLabelsSettings, labelDataPoints = [];
                (labelSettings && labelSettings.show || labelSettings.showCategory) && (labelDataPoints = this.createLabelDataPoints());
                var behaviorOptions;
                return this.interactivityService && (behaviorOptions = {
                    bars: bars,
                    isBreakdown: this.data.isBreakdown
                }), visuals.SVGUtil.flushAllD3TransitionsIfNeeded(this.options), {
                    dataPoints: this.data.series[0].data,
                    behaviorOptions: behaviorOptions,
                    labelDataPoints: labelDataPoints,
                    labelsAreNumeric: !0,
                    labelOrientation: labelSettings.labelOrientation,
                    animateLabels: !suppressAnimations
                };
            }, WaterfallChart.prototype.onClearSelection = function() {
                this.interactivityService && this.interactivityService.clearSelection();
            }, WaterfallChart.prototype.getSupportedCategoryAxisType = function() {
                return visuals.axisType.categorical;
            }, WaterfallChart.prototype.getAvailableWidth = function() {
                return this.currentViewport.width - (this.margin.left + this.margin.right);
            }, WaterfallChart.prototype.getAvailableHeight = function() {
                return this.currentViewport.height - (this.margin.top + this.margin.bottom);
            }, WaterfallChart.prototype.getSentimentColorsFromObjects = function(objects) {
                var defaultSentimentColors = this.colors.getSentimentColors(), increaseColor = powerbi.DataViewObjects.getFillColor(objects, visuals.waterfallChartProps.sentimentColors.increaseFill, defaultSentimentColors[2].value), decreaseColor = powerbi.DataViewObjects.getFillColor(objects, visuals.waterfallChartProps.sentimentColors.decreaseFill, defaultSentimentColors[0].value), totalColor = powerbi.DataViewObjects.getFillColor(objects, visuals.waterfallChartProps.sentimentColors.totalFill, this.colors.getColorByIndex(0).value), otherColor = powerbi.DataViewObjects.getFillColor(objects, visuals.waterfallChartProps.sentimentColors.otherFill, defaultSentimentColors[1].value);
                return {
                    increaseFill: {
                        solid: {
                            color: increaseColor
                        }
                    },
                    decreaseFill: {
                        solid: {
                            color: decreaseColor
                        }
                    },
                    totalFill: {
                        solid: {
                            color: totalColor
                        }
                    },
                    otherFill: {
                        solid: {
                            color: otherColor
                        }
                    }
                };
            }, WaterfallChart.prototype.createLabelDataPoints = function() {
                for (var labelDataPoints = [], data = this.data, xScale = this.xAxisProperties.scale, yScale = this.yAxisProperties.scale, y0 = yScale(0), series = data.series, formattersCache = visuals.LabelUtils.createColumnFormatterCacheManager(), labelSettings = data.dataLabelsSettings, labelUnitsAndPrecision = visuals.LabelUtils.getLabelUnitAndPrecisionForAxis(this.yAxisProperties, labelSettings), _i = 0, series_2 = series; _i < series_2.length; _i++) for (var currentSeries = series_2[_i], _a = 0, _b = currentSeries.data; _a < _b.length; _a++) {
                    var dataPoint = _b[_a], parentRect = {
                        left: xScale(dataPoint.categoryIndex),
                        top: visuals.CartesianHelper.getRectTop(yScale, dataPoint.position, dataPoint.value),
                        width: this.layout.categoryWidth,
                        height: y0 - yScale(Math.abs(dataPoint.value))
                    }, formatString = dataPoint.labelFormatString, formatter = formattersCache.getOrCreate(formatString, this.data.dataLabelsSettings, labelUnitsAndPrecision.units, labelUnitsAndPrecision.getPrecision(!!formatString, currentSeries.type)), text = visuals.LabelUtils.getLabelFormattedText(formatter.format(dataPoint.value)), fontProperties = labelSettings ? labelSettings.fontProperties : visuals.LabelUtils.defaultFontProperties, properties = visuals.FontProperties.toTextProperties(fontProperties, text), textWidth = powerbi.TextMeasurementService.measureSvgTextWidth(properties), textHeight = powerbi.TextMeasurementService.estimateSvgTextHeight(properties, !0), validPositions = this.getValidPositions(labelSettings.position, dataPoint.value);
                    labelDataPoints.push({
                        isPreferred: !0,
                        text: text,
                        textSize: {
                            width: textWidth,
                            height: textHeight
                        },
                        outsideFill: fontProperties.color ? fontProperties.color : visuals.LabelUtils.defaultLabelColor,
                        insideFill: visuals.LabelUtils.defaultInsideLabelColor,
                        parentType: 1,
                        parentShape: {
                            rect: parentRect,
                            orientation: dataPoint.value >= 0 ? 1 : 2,
                            validPositions: validPositions
                        },
                        fontProperties: fontProperties,
                        identity: void 0
                    });
                }
                return labelDataPoints;
            }, WaterfallChart.prototype.getValidPositions = function(position, value) {
                if (0 === value) return WaterfallChart.validZeroLabelPosition;
                switch (position) {
                  case visuals.labelPosition.insideEnd:
                    return [ 4 ];

                  case visuals.labelPosition.insideCenter:
                    return [ 1 ];

                  case visuals.labelPosition.insideBase:
                    return [ 2 ];

                  case visuals.labelPosition.outsideEnd:
                    return [ 16 ];

                  default:
                    return WaterfallChart.validLabelPositionsAuto;
                }
            }, WaterfallChart.prototype.getCartesianVisualCapabilities = function() {
                return {
                    supportsHierarchicalCategoryAxis: !1
                };
            }, WaterfallChart.prototype.getStaticSeriesRole = function() {}, WaterfallChart.formatStringProp = {
                objectName: "general",
                propertyName: "formatString"
            }, WaterfallChart.WaterfallClassName = "waterfallChart", WaterfallChart.MainGraphicsContextClassName = "mainGraphicsContext", 
            WaterfallChart.IncreaseLabel = "Waterfall_IncreaseLabel", WaterfallChart.DecreaseLabel = "Waterfall_DecreaseLabel", 
            WaterfallChart.TotalLabel = "Waterfall_TotalLabel", WaterfallChart.OtherLabel = "Waterfall_OtherLabel", 
            WaterfallChart.CategoryValueClasses = createClassAndSelector("column"), WaterfallChart.WaterfallConnectorClasses = createClassAndSelector("waterfall-connector"), 
            WaterfallChart.AutoLabelPosition = "Auto", WaterfallChart.MinimumBreakdowns = 1, 
            WaterfallChart.MaximumBreakdowns = 20, WaterfallChart.DefaultBreakdowns = 5, WaterfallChart.validLabelPositionsOptions = [ WaterfallChart.AutoLabelPosition, LabelPosition.outsideEnd, LabelPosition.insideEnd, LabelPosition.insideCenter, LabelPosition.insideBase ], 
            WaterfallChart.validLabelPositionsAuto = [ 16, 4, 1, 2 ], WaterfallChart.validZeroLabelPosition = [ 16, 8 ], 
            WaterfallChart;
        }();
        visuals.WaterfallChart = WaterfallChart;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {}));

var powerbi;

!function(powerbi) {
    var visuals;
    !function(visuals) {
        var WaterfallChartWebBehavior = function() {
            function WaterfallChartWebBehavior() {}
            return WaterfallChartWebBehavior.prototype.bindEvents = function(options, selectionHandler) {
                var bars = this.bars = options.bars;
                bars.on("click", function(d) {
                    if (1 !== d.barType) {
                        var position = visuals.InteractivityUtils.getPositionOfLastInputEvent();
                        selectionHandler.handleSelection(d, !options.isBreakdown && d3.event.ctrlKey, position);
                    }
                }), bars.on("contextmenu", function(d) {
                    if (!d3.event.ctrlKey && (d3.event.preventDefault(), 1 !== d.barType)) {
                        var position = visuals.InteractivityUtils.getPositionOfLastInputEvent();
                        selectionHandler.handleContextMenu(d, position);
                    }
                });
            }, WaterfallChartWebBehavior.prototype.renderSelection = function(hasSelection) {
                this.bars.style("fill-opacity", function(d) {
                    return 1 === d.barType ? visuals.ColumnUtil.DefaultOpacity : visuals.ColumnUtil.getFillOpacity(d.selected, d.highlight, hasSelection, !1);
                });
            }, WaterfallChartWebBehavior;
        }();
        visuals.WaterfallChartWebBehavior = WaterfallChartWebBehavior;
    }(visuals = powerbi.visuals || (powerbi.visuals = {}));
}(powerbi || (powerbi = {})), define("CartesianVisuals/cartesianModule", [ "require", "exports" ], function(require, exports) {
    function createCartesianChart(options) {
        return new CartesianChart(options);
    }
    function createWebColumnChartAnimator(options) {
        return new WebColumnChartAnimator(options);
    }
    function createCartesianChartBehavior(behaviors) {
        return new CartesianChartBehavior(behaviors);
    }
    function createColumnChartWebBehavior() {
        return new ColumnChartWebBehavior();
    }
    function createCartesianViewModelAdapter(options) {
        return new CartesianViewModelAdapter(options);
    }
    function createDataDotChartWebBehavior() {
        return new DataDotChartWebBehavior();
    }
    function createLineChartWebBehavior() {
        return new LineChartWebBehavior();
    }
    function createScatterChartWebBehavior() {
        return new ScatterChartWebBehavior();
    }
    function createWaterfallChartWebBehavior() {
        return new WaterfallChartWebBehavior();
    }
    function createRealTimeLineChartAnimator(options) {
        return new RealTimeLineChartAnimator(options);
    }
    function createDashboardColumnChartAnimator(options) {
        return new DashboardColumnChartAnimator(options);
    }
    function createScatterChartMobileBehavior() {
        return new ScatterChartMobileBehavior();
    }
    Object.defineProperty(exports, "__esModule", {
        value: !0
    });
    var visuals = powerbi.visuals, CartesianChart = visuals.CartesianChart, CartesianChartBehavior = visuals.CartesianChartBehavior, CartesianViewModelAdapter = visuals.CartesianViewModelAdapter, ColumnChartWebBehavior = visuals.ColumnChartWebBehavior, DashboardColumnChartAnimator = visuals.DashboardColumnChartAnimator, DataDotChartWebBehavior = visuals.DataDotChartWebBehavior, LineChartWebBehavior = visuals.LineChartWebBehavior, RealTimeLineChartAnimator = visuals.RealTimeLineChartAnimator, ScatterChartMobileBehavior = visuals.ScatterChartMobileBehavior, ScatterChartWebBehavior = visuals.ScatterChartWebBehavior, WaterfallChartWebBehavior = visuals.WaterfallChartWebBehavior, WebColumnChartAnimator = visuals.WebColumnChartAnimator;
    exports.createCartesianChart = createCartesianChart, exports.createWebColumnChartAnimator = createWebColumnChartAnimator, 
    exports.createCartesianChartBehavior = createCartesianChartBehavior, exports.createColumnChartWebBehavior = createColumnChartWebBehavior, 
    exports.createCartesianViewModelAdapter = createCartesianViewModelAdapter, exports.createDataDotChartWebBehavior = createDataDotChartWebBehavior, 
    exports.createLineChartWebBehavior = createLineChartWebBehavior, exports.createScatterChartWebBehavior = createScatterChartWebBehavior, 
    exports.createWaterfallChartWebBehavior = createWaterfallChartWebBehavior, exports.createRealTimeLineChartAnimator = createRealTimeLineChartAnimator, 
    exports.createDashboardColumnChartAnimator = createDashboardColumnChartAnimator, 
    exports.createScatterChartMobileBehavior = createScatterChartMobileBehavior;
}), powerbi.define("PowerBIVisuals/visuals/converter/waterfall.converter", function(imports) {
    function matrixConverter(options) {
        var otherLabelKey = "Waterfall_OtherLabel", dataView = options.dataView, hostServices = options.hostServices, dataLabelSettings = options.dataLabelSettings, sentimentColors = options.sentimentColors, interactivityService = options.interactivityService, tooltipsEnabled = options.tooltipsEnabled, numberOfBreakdowns = options.numberOfBreakdowns, matrix = dataView.matrix, breakdownMetadata = !_.isEmpty(matrix.columns.levels) && matrix.columns.levels[0].sources[0], categoryMetadata = !_.isEmpty(matrix.rows.levels) && matrix.rows.levels[0].sources, yIndex = _.findIndex(matrix.valueSources, function(s) {
            return DataRoleHelper.hasRole(s, "Y");
        }), valueMetadata = matrix.valueSources[yIndex], tooltipsMetadata = _.filter(matrix.valueSources, function(s) {
            return DataRoleHelper.hasRole(s, "Tooltips");
        }), dataPoints = [], categoryValues = [], pos = {
            current: 0,
            min: 0,
            max: 0
        }, totalBreakdownCategories = 0;
        if (breakdownMetadata && categoryMetadata && valueMetadata) {
            var helper_1 = new ConverterHelper(breakdownMetadata, categoryMetadata, valueMetadata), labelFormatString = valueMetadata.format, otherLabel = hostServices.getLocalizedString(otherLabelKey), formatStringProp_1 = WaterfallChart.formatStringProp, rows = matrix.rows.root.children, columns = matrix.columns.root.children;
            if (!_.isEmpty(rows) && !_.isEmpty(columns)) {
                var rowCount = rows.length, columnCount = columns.length, categoryIndex = 0, formattedPreviousRowCategoryValue = void 0, previousCategoryIdentityExprs = void 0, valuesLength = _.size(tooltipsMetadata) + 1;
                rowCount > 0 && (totalBreakdownCategories = _.size(rows[0].values) / valuesLength - 1), 
                numberOfBreakdowns = Math.min(numberOfBreakdowns, totalBreakdownCategories);
                for (var rowIndex = 0; rowIndex < rowCount; rowIndex++) {
                    for (var row = rows[rowIndex], previousRow = rowIndex > 0 ? rows[rowIndex - 1] : void 0, rowCategoryValues = _.map(row.levelValues, function(v) {
                        return v.value;
                    }), formattedRowCategoryValue = _.map(rowCategoryValues, function(c, i) {
                        return converterHelper.formatFromMetadataColumn(c, categoryMetadata[i], formatStringProp_1);
                    }).join(" "), categoryIdentityExprs = helper_1.splitIdentity(row.identity.expr), sorted = [], length_1 = _.size(row.values), columnIndex = 0; columnIndex < length_1; columnIndex += valuesLength) {
                        for (var currentValue = void 0, previousValue = void 0, currentTooltipValues = [], previousTooltipValues = [], breakdownIndex = 0; breakdownIndex < valuesLength; breakdownIndex++) breakdownIndex === yIndex ? (currentValue = AxisHelper.normalizeNonFiniteNumber(row.values[columnIndex + breakdownIndex].value), 
                        previousValue = previousRow && AxisHelper.normalizeNonFiniteNumber(previousRow.values[columnIndex + breakdownIndex].value)) : (currentTooltipValues.push(row.values[columnIndex + breakdownIndex].value), 
                        previousTooltipValues.push(previousRow && previousRow.values[columnIndex + breakdownIndex].value));
                        sorted.push({
                            key: columnIndex,
                            currentValue: currentValue,
                            previousValue: previousValue,
                            difference: (currentValue || 0) - (previousValue || 0),
                            column: columns[columnIndex / valuesLength],
                            currentTooltipValues: currentTooltipValues,
                            previousTooltipValues: previousTooltipValues
                        });
                    }
                    sorted = _.sortBy(sorted, function(d) {
                        return Math.abs(d.difference) * -1;
                    });
                    var topColumns = _.chain(sorted).filter(function(d) {
                        return !d.column.isSubtotal;
                    }).take(numberOfBreakdowns).sortBy(function(d) {
                        return d.difference * -1;
                    }).value(), subtotalColumn = _.find(sorted, function(d) {
                        return d.column.isSubtotal;
                    }), subtotalCurrent = subtotalColumn.currentValue, subtotalPrevious = subtotalColumn.previousValue;
                    if (previousRow) {
                        var topCurrent = _.sum(topColumns, function(c) {
                            return c.currentValue;
                        }), topPrevious = _.sum(topColumns, function(c) {
                            return c.previousValue;
                        }), topColumnIdentityExprs = _.chain(topColumns).map(function(d) {
                            return helper_1.splitIdentity(d.column.identity.expr);
                        }).flatten().value(), showOther = columnCount > numberOfBreakdowns + 1, otherDifference = 0, otherIdentity = void 0, otherTooltipBuilder = void 0;
                        if (showOther) {
                            var otherCurrent = subtotalCurrent - topCurrent, otherPrevious = subtotalPrevious - topPrevious;
                            if (otherDifference = otherCurrent - otherPrevious, otherIdentity = helper_1.createBreakdownOtherIdentity(topColumnIdentityExprs, categoryIdentityExprs, previousCategoryIdentityExprs), 
                            tooltipsEnabled) {
                                otherTooltipBuilder = helper_1.createBreakdownTooltip(formattedRowCategoryValue, formattedPreviousRowCategoryValue, otherLabel, otherCurrent, otherPrevious, otherDifference, formatStringProp_1, hostServices);
                                for (var otherTooltipMeasures = [], previousValues = [], _loop_5 = function(k) {
                                    var currentTooltipValue = subtotalColumn.currentTooltipValues[k], previousTooltipValue = subtotalColumn.previousTooltipValues[k];
                                    if (_.isNumber(currentTooltipValue) && _.isNumber(previousTooltipValue)) {
                                        var currentValue = currentTooltipValue - _.sum(topColumns, function(c) {
                                            return c.currentTooltipValues[k];
                                        }), previousValue = previousTooltipValue - _.sum(topColumns, function(c) {
                                            return c.previousTooltipValues[k];
                                        });
                                        otherTooltipMeasures.push(currentValue - previousValue), previousValues.push(previousValue);
                                    }
                                }, k = 0; k < subtotalColumn.currentTooltipValues.length; k++) _loop_5(k);
                                WaterfallChart.appendTooltipMeasures(otherTooltipMeasures, otherTooltipBuilder, tooltipsMetadata, formatStringProp_1, hostServices, previousValues, formattedRowCategoryValue, formattedPreviousRowCategoryValue);
                            }
                        }
                        for (var otherAdded = !1, _loop_6 = function(dataPoint) {
                            showOther && otherDifference > dataPoint.difference && !otherAdded && (otherAdded = !0, 
                            dataPoints.push(WaterfallChart.createDataPoint(otherDifference, pos.current, sentimentColors, otherLabel, categoryIndex++, otherIdentity, otherTooltipBuilder, dataLabelSettings.fontProperties.color, labelFormatString, 3, {
                                text: !0
                            })), categoryValues.push(otherLabel), pos = WaterfallChart.getNewPositionContext(pos, otherDifference));
                            var formattedCategoryValue = converterHelper.formatFromMetadataColumn(dataPoint.column.value, breakdownMetadata, formatStringProp_1), breakdownIdentityExprs = helper_1.splitIdentity(dataPoint.column.identity.expr), identity_1 = helper_1.createBreakdownIdentity(categoryIdentityExprs, previousCategoryIdentityExprs, breakdownIdentityExprs), tooltipBuilder_1 = void 0;
                            if (tooltipsEnabled) {
                                tooltipBuilder_1 = helper_1.createBreakdownTooltip(formattedRowCategoryValue, formattedPreviousRowCategoryValue, formattedCategoryValue, dataPoint.currentValue, dataPoint.previousValue, dataPoint.difference, formatStringProp_1, hostServices);
                                var tooltipValues = _.map(dataPoint.currentTooltipValues, function(value, index) {
                                    return _.isNumber(value) ? value - dataPoint.previousTooltipValues[index] : value;
                                });
                                WaterfallChart.appendTooltipMeasures(tooltipValues, tooltipBuilder_1, tooltipsMetadata, formatStringProp_1, hostServices, dataPoint.previousTooltipValues, formattedRowCategoryValue, formattedPreviousRowCategoryValue);
                            }
                            dataPoints.push(WaterfallChart.createDataPoint(dataPoint.difference, pos.current, sentimentColors, formattedCategoryValue, categoryIndex++, identity_1, tooltipBuilder_1, dataLabelSettings.fontProperties.color, labelFormatString, 0, {
                                text: !0
                            })), categoryValues.push(formattedCategoryValue), pos = WaterfallChart.getNewPositionContext(pos, dataPoint.difference);
                        }, _i = 0, topColumns_1 = topColumns; _i < topColumns_1.length; _i++) {
                            var dataPoint = topColumns_1[_i];
                            _loop_6(dataPoint);
                        }
                        showOther && !otherAdded && (otherAdded = !0, dataPoints.push(WaterfallChart.createDataPoint(otherDifference, pos.current, sentimentColors, otherLabel, categoryIndex++, otherIdentity, otherTooltipBuilder, dataLabelSettings.fontProperties.color, labelFormatString, 3, {
                            text: !0
                        })), categoryValues.push(otherLabel), pos = WaterfallChart.getNewPositionContext(pos, otherDifference));
                    }
                    var selectorsByColumn = {
                        dataMap: (_a = {}, _a[categoryMetadata[0].queryName] = [ row.identity ], _a),
                        metadata: [ valueMetadata.queryName ]
                    }, selector = Selector.convertSelectorsByColumnToSelector(selectorsByColumn), identity = new SelectionId(selector, (!1), selectorsByColumn), tooltipBuilder = void 0;
                    tooltipsEnabled && (tooltipBuilder = WaterfallChart.createCategoryTooltip(categoryMetadata, valueMetadata, rowCategoryValues, subtotalCurrent, formatStringProp_1), 
                    WaterfallChart.appendTooltipMeasures(subtotalColumn.currentTooltipValues, tooltipBuilder, tooltipsMetadata, formatStringProp_1, hostServices)), 
                    dataPoints.push(WaterfallChart.createDataPoint(subtotalCurrent, 0, sentimentColors, formattedRowCategoryValue, categoryIndex++, identity, tooltipBuilder, dataLabelSettings.fontProperties.color, labelFormatString, 2, {
                        text: !0
                    })), categoryValues.push(formattedRowCategoryValue), 0 === rowIndex && (pos = {
                        current: subtotalCurrent,
                        max: subtotalCurrent,
                        min: subtotalCurrent
                    }), formattedPreviousRowCategoryValue = formattedRowCategoryValue, previousCategoryIdentityExprs = categoryIdentityExprs;
                }
            }
        }
        interactivityService && interactivityService.applySelectionStateToData(dataPoints);
        var xAxisProperties = CartesianHelper.getCategoryAxisProperties(dataView.metadata, void 0), preferredCategoryWidth = CartesianHelper.getPreferredCategoryWidth(xAxisProperties);
        return {
            series: [ {
                data: dataPoints,
                type: valueMetadata && valueMetadata.type
            } ],
            categories: categoryValues,
            categoryMetadata: categoryMetadata[0],
            preferredCategoryWidth: preferredCategoryWidth,
            valuesMetadata: matrix.valueSources,
            legend: WaterfallChart.createLegend(sentimentColors, hostServices, dataView.metadata && dataView.metadata.objects, !0),
            hasHighlights: !1,
            positionMin: pos.min,
            positionMax: pos.max,
            dataLabelsSettings: dataLabelSettings,
            sentimentColors: sentimentColors,
            isBreakdown: !0,
            numberOfBreakdowns: numberOfBreakdowns,
            totalBreakdownCategories: totalBreakdownCategories
        };
        var _a;
    }
    var pbi = powerbi, data = pbi.data, visuals = pbi.visuals, AxisHelper = visuals.AxisHelper, CartesianHelper = visuals.CartesianHelper, converterHelper = visuals.converterHelper, DataRoleHelper = data.DataRoleHelper, Lazy = jsCommon.Lazy, SelectionId = powerbi.visuals.SelectionId, Selector = data.Selector, SQExprBuilder = data.SQExprBuilder, StringExtensions = jsCommon.StringExtensions, WaterfallChart = powerbi.visuals.WaterfallChart, ConverterHelper = function() {
        function ConverterHelper(breakdownMetadata, categoryMetadata, valueMetadata) {
            this.breakdownMetadata = breakdownMetadata, this.categoryMetadata = categoryMetadata, 
            this.valueMetadata = valueMetadata;
        }
        return ConverterHelper.prototype.splitIdentity = function(expr) {
            return data.ScopeIdentityExtractor.getKeyValuePairs(expr);
        }, ConverterHelper.prototype.createBreakdownIdentity = function(categoryIdentityExprs, previousCategoryIdentityExprs, breakdownIdentityExprs) {
            var selectorsByColumn = {
                dataMap: (_a = {}, _a[this.breakdownMetadata.queryName] = [ data.createDataViewScopeIdentity(SQExprBuilder.inValues(_.map(categoryIdentityExprs, function(c) {
                    return c.left;
                }).concat(_.map(breakdownIdentityExprs, function(c) {
                    return c.left;
                })), [ _.map(previousCategoryIdentityExprs, function(c) {
                    return c.right;
                }).concat(_.map(breakdownIdentityExprs, function(c) {
                    return c.right;
                })), _.map(categoryIdentityExprs, function(c) {
                    return c.right;
                }).concat(_.map(breakdownIdentityExprs, function(c) {
                    return c.right;
                })) ])) ], _a),
                metadata: [ this.valueMetadata.queryName ]
            }, selector = Selector.convertSelectorsByColumnToSelector(selectorsByColumn);
            return new SelectionId(selector, (!1), selectorsByColumn);
            var _a;
        }, ConverterHelper.prototype.createBreakdownOtherIdentity = function(topValues, categoryIdentityExprs, previousCategoryIdentityExprs) {
            var selectorsByColumn = {
                dataMap: (_a = {}, _a[this.breakdownMetadata.queryName] = [ data.createDataViewScopeIdentity(SQExprBuilder.not(SQExprBuilder.inValues([ this.breakdownMetadata.expr ], _.map(topValues, function(v) {
                    return [ v.right ];
                })))) ], _a),
                metadata: [ this.valueMetadata.queryName ]
            };
            selectorsByColumn.dataMap[this.categoryMetadata[0].queryName] = [ data.createDataViewScopeIdentity(SQExprBuilder.inValues(_.map(categoryIdentityExprs, function(c) {
                return c.left;
            }), [ _.map(previousCategoryIdentityExprs, function(c) {
                return c.right;
            }), _.map(categoryIdentityExprs, function(c) {
                return c.right;
            }) ])) ];
            var selector = Selector.convertSelectorsByColumnToSelector(selectorsByColumn);
            return new SelectionId(selector, (!1), selectorsByColumn);
            var _a;
        }, ConverterHelper.prototype.createBreakdownTooltip = function(category, previousCategory, breakdownCategory, value, previousValue, difference, formatStringProp, hostServices) {
            var _this = this, tooltipBuilder = new visuals.LazyTooltipBuilder();
            if (this.breakdownMetadata && tooltipBuilder.withLazyValue(new Lazy(function() {
                return {
                    displayName: _this.breakdownMetadata.displayName,
                    value: converterHelper.formatFromMetadataColumn(breakdownCategory, _this.breakdownMetadata, formatStringProp)
                };
            })), this.valueMetadata && (null != previousValue && tooltipBuilder.withLazyValue(new Lazy(function() {
                return {
                    displayName: previousCategory + " " + _this.valueMetadata.displayName,
                    value: converterHelper.formatFromMetadataColumn(previousValue, _this.valueMetadata, formatStringProp, !1)
                };
            })), null != value && tooltipBuilder.withLazyValue(new Lazy(function() {
                return {
                    displayName: category + " " + _this.valueMetadata.displayName,
                    value: converterHelper.formatFromMetadataColumn(value, _this.valueMetadata, formatStringProp, !1)
                };
            })), null != difference)) {
                var value_1 = converterHelper.formatFromMetadataColumn(difference, this.valueMetadata, formatStringProp, !1);
                value_1 = WaterfallChart.createPercentTooltipValue(value_1, difference, previousValue), 
                tooltipBuilder.withLazyValue(new Lazy(function() {
                    return {
                        displayName: StringExtensions.format(hostServices.getLocalizedString("Waterfall_BreakdownDifferenceTooltip"), _this.valueMetadata.displayName),
                        value: value_1
                    };
                }));
            }
            return tooltipBuilder;
        }, ConverterHelper;
    }();
    return {
        matrixConverter: function(options) {
            return matrixConverter(options);
        }
    };
});